Possible Duplicate:
pow() isn’t defined
void octal2decimal(char *octal, char *decimal) {
int oct = atoi(octal);
int dec = 0;
int p = 0;
while (oct!=0) {
dec = dec + (oct%10) * pow(8,p++); //since oct is base 8
oct/=10;
}
*decimal = (char)dec;
*/
}
For the following code above I get this error I dont know why I include math.h
but still i get this errors
/tmp/cck07bLe.o: In function 'octal2decimal':
data-converter.c:(.text+0x35f): undefined reference to 'pow'
collect2: ld returned 1 exit status
What does it mean? and how can I fix it?