#include <stdio.h>
|
#include <wchar.h>
|
int
fputws (const wchar_t * restrict ws, FILE * restrict fp); |
#include <stdio.h> #include <wchar.h> /* Illustrates how to use fputws API */ int example_fputws(wchar_t *buf) { FILE *fp = NULL; int retval; /* open the file for writing*/ fp = fopen("write.txt","r"); if(fp == NULL) { wprintf(L"Error: File open\n"); return (-1); } /* Write the characters into the file */ retval = fputws(buf, fp); /* Close the file open for writing */ fclose(fp); /* return the number of characters written */ /* into the file */ return (retval); }
[EBADF] | |
The fp argument supplied is not a writable stream. | |
The fputws function may also fail and set errno for any of the errors specified for the routine write.
The fputws function conforms to -p1003.1-2001.
© 2005-2007 Nokia |