In the code below, I have to first take the string, and remove the newline value by setting input[length-1]=0; Is there a simpler way to do this?
Code:void input(){ int continu=1; char input[256]; int inlength; while (continu==1){ printf("\n\nEnter Command <h=help>: "); fgets(input, 25, stdin); inlength=strlen(input); input[inlength-1]=0; if (strcmp(input, "x")==0){continu=0;} } }