So I have a string like this:
char numbers[] = "123,125,10000000,22222222222]"
This is an example, there can be lots more of numbers in the array but it will certainly end with a ].
So now I need to convert it to an array of unsigned long longs. I know I could use strtoull() but it takes 3 arguments and I don't know how to use that second argument. Also I would like to know how I can make my array have the right length. I would like to have my code look like this, but not in pseudocode but in C:
char numbers[] // string of numbers seperated by , and at the end ]
unsigned long long arr[length] // get the correct length
for(int i = 0; i < length; i++){
arr[i]=strtoull(numbers,???,10)// pass correct arguments
}
Is this possible in C to do it like that?