Hi i have the below code and for some reason am getting the error and can't seem to work out why.
warning: return makes integer from pointer without a cast
The code i have is:
long convertToInt(char *convert) {
char *p = convert;
while(*p){
if(isdigit(*p)) {
long val = strtol(p, &p, 10);
return val;
} else {
p++;
}
}
return NULL;
}