nAzGiRl2005
11-08-2005, 07:17 PM
I have the following lines of code, and on the lines where I have used the "strtok" function, I'm getting this error: "Incompatible Types in Assignment". Please help me find out what's wrong:
int main()
{
char func_str[10];
char *func;
char name[10];
char phone[10];
while(1)
{
printf("please enter function:\n");
func = gets(func_str);
printf("**%c**\n", func);
char delim[] = " "; // space delimeter
if(func[0]=='i')
{
name = strtok(func, delim);
printf("%s",name);
phone = strtok(func, delim);
printf("%s", phone);
insert(name,phone);
break;
}
}
}
int main()
{
char func_str[10];
char *func;
char name[10];
char phone[10];
while(1)
{
printf("please enter function:\n");
func = gets(func_str);
printf("**%c**\n", func);
char delim[] = " "; // space delimeter
if(func[0]=='i')
{
name = strtok(func, delim);
printf("%s",name);
phone = strtok(func, delim);
printf("%s", phone);
insert(name,phone);
break;
}
}
}