Jump to content
  • Advertisement

Archived

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

cpp boy

Loading mutlti lines

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

Hi People. I know I''m asking a lot lately, but I''m in a learning session so what the hey here it is. I''m currently making a text editor(totaly home made) and everything goes just right until it''s time to load. When I save everything goes just fine and does it the way I whant. But when I load, it only loads 1 line of text. What I want is to load every line, cause this is a text editor and a text editor is supposed to load more than one line. Here is how I do it. fin file; file.open(filename); file.getline(buffer, 50); SetWindowText(bla, buffer); I''m currently using win32 api and not mfc or any dialog box. Please Help me ! Kevin

Share this post


Link to post
Share on other sites
Advertisement
Well, the getline function does just what its name says - it gets you one line. You can try

file.getline(buffer, 50, EOF)

to change the delimiter to the end-of-file character to get the whole file, but you''ll probably need a much bigger buffer than that.

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!