I'm doing a command interpreter and one of the commands must have as result quiting from the program. When user inserts "q", the program should stop executing.
I've written this, but it seems very useless.
Thanks in advance.
#include <stdio.h>
#include <stdlib.h>
void exiting (char x){
if (x=='q') exit(0);
int main(){
char x;
scanf("%c", x);
exiting(x);
return 0;
}