How do you return a value and pointer from a function?
I know how to use return to pass back a value and/or a pointer but would like to do both.
Code:
//EX: Not sure I declared ptrStrgPlus4 correctly to have it be
// a pointer to strg+4 (ie '.') on return from the getBoth function
int num; char strg[5]="123.456"; char *ptrStrgPlus4;
x = getBoth(10, strg, *ptrStrgPlus4);
// Would like to return the num*10, plus a pointer to the '.'
int function getBoth(num, string, *stringPtr) {
// I know the next line doesn't work
*stringPtr = string+4; // Return pointer to 4th char in the string
return (num*10);
}
Any examples or help would be greatly appreciated.