Here's my code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void)
{
char terminal[100];
printf("Enter cmds: ");
scanf(" %s", terminal);
if(strcmp(terminal, "help") == 0){
printf("test");
scanf(" %s", terminal); // trying to detect if a user types
// "help" the menu will pop up again
}
return 0;
}
When a user types "help", the menu pops up, (good so far). But when they type "help" again, the menu does not pop up. Does anybody know what is going on?
do...whileloop is what you want?