Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

cowsarenotevil

Another file io problem

This topic is 5654 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

I almost have it working, but I have the line fin.get(faces[facecount].vertex1, ''/''); in my code, and it returns the whole line, including about five slashes, and stops, as if the delimiter was \n. What am I doing wrong? -~-The Cow of Darkness-~-

Share this post


Link to post
Share on other sites
Advertisement
facecount.vertex1 is a an array of chars... I can''t read for some reason, I missed the word discarded:

quote:

If the delimiter is found it is not extracted from the input stream and remains as the next character to be extracted. Use getline if you want this character to be extracted (and discarded).



Thanks

-~-The Cow of Darkness-~-

Share this post


Link to post
Share on other sites
Hmmm... it still won''t work. I used fin.getline(faces[facecount].vertex1, ''/''); with faces[facecount].vertex1 as an array of 20 chars [like before], and for some reason it ignores the slashes. I reads in the whole line, which I don''t want. It''s annoying.

-~-The Cow of Darkness-~-

Share this post


Link to post
Share on other sites
So you want the function to terminate when it comes to '/', right? Hmm, I spose you already have it figured out if you need two slashes or if they're going the right directions or whatever..

istream& get (char* s, streamsize n, char delim );
is the function you want to use for the char array.

You prolly want it to look like:

fin.getline(faces[facecount].vertex1, 20, '/');
right?

Good luck!

Kings of Chaos

[edited by - n0ob on March 31, 2003 10:48:15 AM]

Share this post


Link to post
Share on other sites
Thanks... I didn''t think I''d need the number of characters, so I just put the delim. I used getline though because it throws out the delimiter. Now I only have to fix the numerous other errors...

-~-The Cow of Darkness-~-

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!