I just want to read from input a string of the form "c4 d5" and save two substring :
str1 = "c4"
str2 = "d5"
I tried:
char action[5];
char str1[2];
char str2[2];
scanf("%s", action);
strncpy(str1, &action[0], 2);
strncpy(str2, &action[3], 2);
but it gives me strange behaviors....
Also as I am learning c, I'm looking for both solutions using only char * and only char[] (either in input and output).