[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
QbasicFAQ_WhereToGetIt » Calculating and Validating NMEA Checksums » JAD » TurboCppHelloWorld » burst » Alpha » CDataType » QbasicFAQ_Function » BeginnersGuideToVB » JAP » CFclose
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
QbasicFAQ_WhereToGetIt » Calculating and Validating NMEA Checksums » JAD » TurboCppHelloWorld » burst » Alpha » CDataType » QbasicFAQ_Function » BeginnersGuideToVB » JAP » CFclose
(C) fopen
'File Close', a function used in file I/O.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>
'fclose' links
Code links
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
