I have a few set of values in a single char* variable such as this:
char* a1 = "1234 4567 789";
char* a2 = "123 445";
They are separated by white space.
I am trying to retrieve the last set of value such as 789 and 445 from the char*, but I am not too sure how to do this.
I am currently doing this:
trimmed[strchr(trimmed, ' ') - trimmed] = '\0';
This only nets me the second set of value which doesn't work if there are more than 2 inputs.
Is there a good way to extract the final set of value irregardless whether if there is 1 or 3 inputs?