Converting a string of integers to integers
Posted on 2003-03-18
I have the following say string
char *chars = "1 2 3 4 5";
I need to be able to take those integers out and put them in a queue.. void test_sidea(char *cars)
void myFunction(char* cars)
unsigned int counter = 0;
cars = strtok(cars, " ");
while (cars != NULL)
cars = strtok(NULL, " "); // tokenaizes it...
queueSideA.enqueue (?????) // how can I convert from string to int and add as i go through the loop ?
counter++; // keeps track of tokens
If anyone can help me that would be great.. Thank You in advance