Hey everyone! (sorry in advance for my bad english, I'm french)
I have to type a function that will get the content of a .txt file and then put the numbers in an array. My problem is that the file contains both letters AND numbers. On top of that, I need to convert the char array that will contains my numbers into an int array... I guess I have to use ASCII but I don't know how to use it to convert "0" into 0, "1" into 1, "2" into 2 etc.
Thanks for your reply! I dont' have to worry about that problem anymore :)
I still have a problem though...
As I said, I need to get the content of a txt file (letters and numbers) and put it into an array. Here's an example of the kind of file I need to deal with :
letters : 4
numbers : 16
6 7 6 7
7 6 7 7
6 6 6 6
7 7 6 6
a a a a
I know how to put the content of the file in the array, that's not a problem. The real problem is to extract the important information of that array I just made and put it in others variables and arrays.
So basically, I want to know how to take the "4" and the "16" and put in into different variables (not knowing their position in the array, because it could change) and how to take a the rest of the file (letters and numbers in a table) and put them in an other array.
I know it may sound complicated but thanks in advance for your answer and if you want me to explain it in an other way or anything, no problem, I will do my best.
This is very important for the rest of my program because I need to work with the number of letters and the number of numbers as variables and with the array containing the characters in a table.