how can i take numbers and characters from a file and put it into a variabel (in this case into an array).
i already know the basics of output to files (using ofstream) but how can i get certain part of a file, and store that into my program in a variabel? like the information for maps in a game engine for example
The easiest way is to play around with getline() function and if you know what to expect on the line where you get the info you just read whatever you need to read with myfile << number << character << something . Getline is also capable of reading the line till the certain character is met, default one is '\n'.
If you want something more sophisticated and own, well, read all characters into your own chars buffer and play with.