So what I want the code to do so far is take an expression lets say 35x + 17y = 5 and break it down into three values, 2 integers and a character. 35, 17, and + so I can tell it how to evaluate it. Here is my code so far
#include <stdio.h>
#include <string.h>
int main(void)
{
char * exp;
char * tok;
printf("Enter an expression: ");
scanf("%s", &exp);
tok = strtok(exp, " x+-y=");
while (tok != NULL)
{
printf ("%s\n",tok);
tok = strtok (NULL, " x+-y=");
}
}
I get an error with strtok saying that the expression cannot be evaluated