i want to have my game read a script from a text file and be able to compare it to other chars and ints. I have been using fgets to get the info from the file but i can never compare the info from the file to make events happen. How would i compare this info to other variables. I'm not very experienced with c++ so any help would be nice.
Edit: i guess i should give an example of what im trying to do
textfile
image.jpg
stuff.jpg
etc.
code:
std::vector<SDL_Surface> gameImages;
char line[30];
while(fgets(line, 30, pFile) != NULL)
{
//loadImage takes a const char as parameter and returns a surface
gameImages.push_back(loadImage(line, -1));
}
i cant get this to work along with other similar actions
Edit: i guess i should give an example of what im trying to do
textfile
image.jpg
stuff.jpg
etc.
code:
std::vector<SDL_Surface> gameImages;
char line[30];
while(fgets(line, 30, pFile) != NULL)
{
//loadImage takes a const char as parameter and returns a surface
gameImages.push_back(loadImage(line, -1));
}
i cant get this to work along with other similar actions