[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CFscanf
Example:
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CFscanf
(C) fscanf
A function that scans a file for data. It is defined in ?stdio.h.Example:
int main(void) { int file_inpt; FILE *fp; if((fp=fopen("filename.txt","r"))==NULL) /* This checks if the file exists */ { printf("Error opening / reading file!\n"); exit(1); } fscanf(fp,"%d",file_inpt); printf("%d",file_inpt); fclose(fp); }
- include <stdio.h>
- include <stdlib.h> /* For exit() */
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
