Yeah, I understood your problem, but gave you an example of passing back values through parameters, so you could extrapolate for your situation. I didn't really want to write your whole solution for you. Note that passing a string (char array) to a function passes a pointer to the first element, so you don't need to do anything else. Treat it like an array in the function. Changing array[3] in the function will change array[3] in the calling code as well:
Code:void parseIP(char *input, char *output) { ... strcpy(output, "foobar"); // this will change the actual string you passed in }



5Likes
LinkBack URL
About LinkBacks



