不知道咱们c++中有没有一个函数,来判断输入的类型是整形还是字符行。具体演示谢谢。

解决方案 »

  1.   

    如果是控件,DDX可凑合着用。
      

  2.   

    在pretranslatemessage中,截获键盘消息WM_KEYDOWN或者派生CEdit类,在onchar中判断
      

  3.   

    isalnum Tests whether an element in a locale is an alphabetic or a numeric character. 
    isalpha  Tests whether an element in a locale is alphabetic character. 
    iscntrl  Tests whether an element in a locale is a control character. 
    isdigit  Tests whether an element in a locale is a numeric character. 
    isgraph  Tests whether an element in a locale is an alphanumeric or punctuation character. 
    islower  Tests whether an element in a locale is lower case. 
    isprint  Tests whether an element in a locale is a printable character. 
    ispunct  Tests whether an element in a locale is a punctuation character. 
    isspace  Tests whether an element in a locale is a whitespace character. 
    isupper  Tests whether an element in a locale is upper case. 
    isxdigit  Tests whether an element in a locale is a character used to represent a hexadecimal number. 
      

  4.   

    这些函数怎么用呢。比如我如果要是判断一个编辑框中如果输入的是 字符行,如果是整行然后自动弹出 messagbox提示输入必须是字符。谢谢了。