Jump to content
  • Advertisement
Sign in to follow this  

Read PhysFS_File to array

This topic is 3094 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´m trying to read a PhysFS_File to array but I don´t have a clue how to do it. Before I started to use PhysFS i used getline and it worked perfectly, but now I want to use PhysFS and getline doesn´t seem to work. The file I try to read contains my map-data, rows and columns (separated by semicolons) of integers and I want to read it to a 2D array. This is how I read it before PhysFS ifstream myfile("MyFile.map"); while(!myfile.eof()) { getline(myfile,MyMapArray[a],';'); if(a == TilesX-1) { a=0; ++b; getline(myfile,MyMapArray[a],';'); } a++; } } How can I do the same thing with a PhysFS-file??

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!