VS2005中的VC++不支持这个定义 const MAXLEN = 128;报出这样的错:
error C4430:missing type specifier - int assumed Note: C++ does not support default-int
这是什么问题,请问高手,该怎么解决?多谢!

解决方案 »

  1.   

    const int MAXLEN = 128;  -> "int"
      

  2.   

    改成 #define MAXLEN 128
      

  3.   

    to anothervip(anothervip) :
    谢谢你的参与,您说的:const int MAXLEN = 128;  -> "int"是什么意思?to  baichi2002(我是白痴) :您的方法有效,但是VS2005真的就不能再用那个说明了吗?这样有多少源文件要改啊?
      

  4.   

    const MAXLEN = 128;  
    不知道这句你是想定一一个什么类型的常量,缺少数据类型!
    const int MAXLEN=128;意思是创建一个整型常量
    或者这样#define MAXLEN 128  这是定义了一个MAXLEN宏
      

  5.   

    呵呵,你小不在意的忘记声明数据类型了,IDE当然认不出来了
      

  6.   

    const MAXLEN = 128;
    const 数据类型关键字 MAXLEN = 128;
      

  7.   

    to yuanbocsut(打盹的神仙) : 您好!你说的这种语法你试过吗,我试了,编译通不过,报下面的错:error C2143 syntas error : missing ':' before 'constant'error C2106 '=' : left operand must be l-value你试的时候有没有这样的问题?
      

  8.   

    const int MAXLEN = 128;
    #define MAXLEN 128
      

  9.   

    to  yuanbocsut(打盹的神仙)  :
    你说的是对的!,我把MAXLEN改成 MaxLen就通过编译了!,谢谢你!