I wrote a C program that converts each base to another one..but when I'm going to convert ascii code to number I face a problem... please help :) I think my problem is because I cant convert assci to number and it says: ====> undefined reference to `pow'
#include <stdio.h>
#include <math.h>
int CB, DB;
void base(void)
{
int adad2[100], i=-1,j;
char adad1[100], ch;
long int num1=0, num2=0;
printf("Enter your num: ");
scanf("%c", &ch);
do
{
i++;
scanf("%c", &adad1[i]);
} while(adad1[i]!='\n');
j=i-1;
for(i=j;i>=0;i--)
{ //converts the base to 10.
if(adad1[i]<='9'&& adad1[i]>='0')
{
num1+=((long int)pow((float)CB,(j-i)))*(((int)adad1[i])-48); //converting ascii code to num
}
else if(adad1[i]<='Z'&&adad1[i]>='A')
{
num1+=((long int)pow((float)CB,(j-i)))*(((int)adad1[i])-55);
}
else if(adad1[i]<='z'&&adad1[i]>='a')
{
num1+=((long int)pow((float)CB,(j-i)))*(((int)adad1[i])-87);
}
}
i=0;
while(num1>=DB)
{ //converts the base to b. (START)
adad2[i]=num1%DB;
i++;
num1/=DB;
}
adad2[i]=num1; //converts the base to b. (END)
printf("\nResult: \n");
for(;i>=0;i--)
{ //prints the result.
if(adad2[i]<=9&&adad2[i]>=0){
printf("%d",adad2[i]);
}
else if(adad2[i]>=10&&adad2[i]<=35){
printf("%c",(char)(adad2[i]+55));
}
}
}
void main(void)
{
printf("\nEnter current base: ");
scanf("%d", &CB);
printf("\nEnter desired base: ");
scanf("%d", &DB);
base();
}