[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CFprintf
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CFprintf
(C) fprintf
'File Print Formatted', a function used in file I/O. This command is found in ?stdio.h.Example
int main (void) { FILE * pFile = 0; char myText[100]; /* Open the file myFile.txt for writing */ pFile = fopen ("myFile.txt","w"); /* Assume file has been opened succesfully */ assert(pFile != 0); /* Prompt for input */ puts("please type some text:"); /* Get the input in the character buffer 'myText'*/ gets(myText); /* Write character buffer 'myText' to file */ fprintf (pFile, "Your text: %s\n",myText); /* Close the file */ fclose (pFile); return 0; }
- include <stdio.h>
- include <assert.h>
'fprintf' links
Code links
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
