[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
CppDeclaration » modem » Borland » CppVclCodeSnippets » JTAG » RSS » CFscanf » open source » CppHelloWorld » IBM » CFprintf

(C) fprintf

'File Print Formatted', a function used in file I/O. This command is found in  ?stdio.h.

Example

  1. include <stdio.h>
  2. include <assert.h>
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; }


'fprintf' links

Code links



last edited (November 29, 2006) by bilderbikkel, Number of views: 2513, Current Rev: 2 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Site Management by Lars Hagelin at Kontantkort.se.