I am running C in eclipse using MinGW, and run into problems when I try and call strtok(), despite the fact that the program runs on my professor's computer just fine. Did i not install/setup MinGW correctly (i thought none of my programs would run if this were the case, however)?
As I said, the code runs fine on another computer, so I'd assume that the code itself is not at fault, but my computer/setup.
I am pretty new to setting up my own environment, so any help is greatly appreciated!
EDIT:When I run the program, it simply fails (program.exe has stopped working). When I run the debugger, it gets to the line:
char *token = strtok(string, ",");
And a window pops up saying: No source available for "strtok() at 0x752bce40"
Building the code provides no error messages or warnings.
EDIT2: The whole code for up until this line is:
char *val1 = "5,7,3,4,";
char *val2 = "5,7,4,";
node *n = NULL;
insert(&n, toSet(val1));
where toSet is:
set toSet(char *string)
{
set out = (set)malloc(n*sizeof(int));
int result, place;
result = place = 0;
char *token = strtok(string, ",");
--more code--
FINAL EDIT: Changing *val1 to val1[] worked, thanks! But why would it then run on my professor's computer?