#include <stdio.h> #include <string> int main(void) { char recup[1024]; char* command; // get the command line printf("My shell\t:"); gets(recup); //print to check what we get printf("recup=%s\n",recup); // cut and print the different commands command = strtok (recup," -"); while (command != NULL) { printf ("%s\n",command); command = strtok (NULL, " -"); } return 0; }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question