Hi,
I've been trying to get this to work properly...maybe you guys can help me out here.
I'm trying to take a string and put each word into an array.
Ex: This prog is great
var1 = This
var2 = prog
and so on.
Heres the code I have to date:
----------------------
/* Seperate the words from the input string */
for (x = 0; x < strlen(command_entry); x ++) {
if (strcmp(command_entry[x], " ") == 0){ /* Found a space */
while (y < x) {
command_entry_sep[total_commands][y] = command_entry[x][y];
}
total_commands += 1;
y = x; /* May have to add one here to avoid space */
}
}
----------------------
both y and total_commands were initialyzed to zero.(earlier in the code) and are still 0.
This keeps core dumping. *sigh* Any help would be great!
Thanks in advance,
Chris