?
2013-10-03 12:20:45 UTC
Here is my program, i think the problem is how i am using "strsep", it gives a segmentation fault error.
#include
#include
#include
int main()
{
char *token;
char *string;
//fgets(string, 16, stdin);
string = "add(2,2)";
token = strsep(string, "(,)");
if (token[0] ="add")
{
printf("%d\n", atoi(token[1])+atoi(token[2]));
}
return 0;
}