Advertisement

How to read text from a file?

Started by October 20, 2000 07:28 PM
10 comments, last by Possibility 24 years, 3 months ago
I read one character at a time and use my own end-of-data-field characters to indicate when to stop reading. So basically what I do after the obvious opening of the file stream is this:
    while((c=getc(filestream))!=''`''){      \\I use an accent character \\for the endof data field characterbuffer[x]=c;x++;}buffer[x]=''\0'';    


yup, that''s how I do it.

Are you even trying to be intelligent?
'cuz if you are, it ain't workin'

[Formerly "capn_midnight". See some of my projects. Find me on twitter tumblr G+ Github.]

@Possibility

You can change the path where visual studio will search for files without giving a complete path in the project settings. The standard setting is the project directory and not the debug directory. This seems just right to me because when you compile a release version you will have to copy the file.

Yoshi
The last truth is that there is no magic(Feist)

This topic is closed to new replies.

Advertisement