#include <stdbool.h>
#include <string.h>
#include <ctype.h>
void noMoreNewline(char* theString){
char * isANewline;
isANewline = strrchr(theString, '\n');
if(isANewline){
*isANewline = '\0';
}
}
int main(void){
char doYouWantToQuit[10];
printf("Enter quit to quit: ");
fgets(doYouWantToQuit, 10, stdin);
noMoreNewline(doYouWantToQuit);
printf(doYouWantToQuit);
}
댓글 없음:
댓글 쓰기