Im trying to develop a Logic game with Cocos2d-x, and one of the categories is going to be “Brain teasers”. In one of my scenes, i want to display the name, the question and the answer for one determinate question. Now i have text files containing the info of each question on a line.
NameOfQuestion1 - Question1 - Answer1 NameOfQuestion2 - Question2 - Answer2 NameOfQuestion3 - Question3 - Answer3 ...
The first problem is i don’t know what’s the best aproach to store this information: 1 text file?, 3 text files?, in wich format?, SQL?
The second problem is i dont know how to acces to one particular string on those files (for example the number 3). I was thinking on reading the whole file then use STL functions to filter/find the question and display it, but im afraid it can be slow considering the text file can have several thousands of words.
¿There is any easy & fast way to read just one string on a known line of a text file?
Thank you for your time!