Sign in to follow this  

Loading a text file using stdio.h

This topic is 4761 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

You are using pure C?
IF so,you may do like this:

#include<stdio.h>

int main()
{
FILE *fptr;
if((fptr=fopen("textfile.txt","rb+"))==NULL)
{
printf("An error occured");
return 1;
}
/*Your code here*/
fclose(fptr);
return 0;
}

Share this post


Link to post
Share on other sites
I found more code samples for stdio.h out there, so I thought if I could learn it, then I would be able to understand it better, before moving onto fstream.

Share this post


Link to post
Share on other sites

This topic is 4761 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this