I have a 2d array with 5 strings
Ex: blueone greentwo redthree pinkfour yellowfive
Now I want to parse these strings and get the numbers. "one", "two", "three", "four", "five"
Then convert these strings to there numerical values. 1,2,3,4,5. How would I do this?
I using a struct for those numbers
struct example{
int numbers;
};
char array[5][2] = { "blueone", "greentwo", "redthree", "pinkfour", "yellowfive" };
example parse;
EDIT: This what I'm working with:
for( int i = 0; i < 5; i++ )
{
deck[i].numbers = array[i][0];
}
The output: 98 103 114 112 121
These are the ascii decimals for the letters b g r p y.