YelloFello
Programmer
9 hours on my own...now I just need a little push.
I intput a string array in the following format .... " 55-dave","32-bab",etc.
55 is the score from test
dave is name of test taker.
I can get "55" out of the string but I can't seem to get it converted to an int so I can put it in an array for sorting.
I have tried to use atoi() but, it doesn't like the fact that I try to use a string array in the parameters...
ex.
string b_score[] = {"55-dave"};
int x = atoi( b_score[]);
Is there a better way ( i'm sure there is) to go about this?
1 more question..should I use char arrays instead of strings?...
I've only been at this for 5 weeks so anything is helpful.
I intput a string array in the following format .... " 55-dave","32-bab",etc.
55 is the score from test
dave is name of test taker.
I can get "55" out of the string but I can't seem to get it converted to an int so I can put it in an array for sorting.
I have tried to use atoi() but, it doesn't like the fact that I try to use a string array in the parameters...
ex.
string b_score[] = {"55-dave"};
int x = atoi( b_score[]);
Is there a better way ( i'm sure there is) to go about this?
1 more question..should I use char arrays instead of strings?...
I've only been at this for 5 weeks so anything is helpful.