首页 > 解决方案 > 如何检查用户在我的字符中输入的多个字符?

问题描述

do{
    char reply;

    printf("Enter your choice > ")
    scanf("%c", &reply)

    if (isdigit(reply) != 0){
        //inside are my contents not really important       
        //what I want to ask is, if user input 123, because it is a char, hence 1 will be taken but it is a wrong input. How can i check it and print a "invalid input"?
    
    }

}while (reply != 3)

标签: cchar

解决方案


推荐阅读