Compartilhar via


fputs, fputws (Windows CE 5.0)

Send Feedback

Developing an Application > Microsoft C Run-time Library for Windows CE > Run-time Library Reference

Write a string to a stream.

int fputs(    const char*string,FILE*stream);int fputws(    const wchar_t*string,FILE*stream);

Parameters

  • string
    Output string.
  • stream
    Pointer to FILE structure.

Return Values

Each of these functions returns a nonnegative value if it is successful.

On an error, fputs returns EOF, and fputws returns WEOF.

Remarks

Each of these functions copies string to the output stream at the current position.

fputws copies the wide-character argument string to stream as a multibyte-character string or a wide-character string according to whether stream is opened in text mode or binary mode, respectively.

Neither function copies the terminating null character.

Generic-Text Routine Mappings

TCHAR.H Routine _UNICODE Defined
_fputts fputws

For more information about TCHAR.H routines, see Generic Text Mappings.

Example

/* FPUTS.C: This program uses fputs to write
 * a single line to the stdout stream.
 */

#include <stdio.h>

void main( void )
{
   fputs( "Hello world from fputs.\n", stdout );
}

Output

Hello world from fputs.

Requirements

OS Versions: Windows CE 2.0 and later.
Header: stdlib.h.
Link Library: coredll.dll.

See Also

fgets | gets | puts | _putws

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.