Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void read_from_file (char file_name[])
- {
- FILE *f;
- printf("Reading from the file %s :\n\r",file_name);
- f = fopen (file_name, "rt");
- if (f == NULL)
- {
- printf ("Can't open the file %s ", file_name);
- exit(1);
- }
- else
- {
- printf("The file %s has been opened \n\r", file_name);
- for (fscanf(f,"%c", &c); !feof (f); fscanf (f,"%c", &c))
- fprintf (stdout, "%c", c);///?fscanf למה לא
- if (fclose(f))
- exit (1); //the closing wasnt sucssesful
- else
- printf ("\n\rThe file %s has been closed", file_name);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement