Hello everyone,

I want to read a string with scanf and then devide it into two parts with strtok by using space as the delimiter.

Well, till now I'm this far

Code:
char str[MAX_CHARS];
char *cmd;
char *param;
char delim[] = " ";
	
scanf("%s", str);

cmd = strtok(str, delim);
param = strtok(NULL, delim);
This simply doesn't work with space, but if I use e.g. comma instead of space, everything works perfectly.
I presume I have to alter the scanf call in some way, but I don't know how, and for the record if I use gets instead of scanf it works perfectly, too.

Thanks in advance.