zoukankan      html  css  js  c++  java
  • 一个小问题,c++

    void main()
    {
      for(int i=0;i<2;i++)
      {
         //code
      }
    }

    VC++编译器给出以下的信息:
    --------------------Configuration: X - Win32 Debug--------------------
    Compiling...
    X.C
    E:\Project\X.C(15) : error C2143: syntax error : missing ';' before 'type'
    E:\Project\X.C(15) : error C2143: syntax error : missing ';' before 'type'
    E:\Project\X.C(15) : error C2143: syntax error : missing ')' before 'type'
    E:\Project\X.C(15) : error C2143: syntax error : missing ';' before 'type'
    E:\Project\X.C(15) : error C2065: 'i' : undeclared identifier
    E:\Project\X.C(15) : warning C4552: '<=' : operator has no effect; expected operator with side-effect
    E:\Project\X.C(15) : error C2059: syntax error : ')'
    E:\Project\X.C(16) : error C2143: syntax error : missing ';' before '{'
    执行 cl.exe 时出错.

    X.exe - 1 error(s), 0 warning(s)

    ------------------------------------------------------------------------------------


    现在把程序改成这样:

    void main()
    {
      int i;
      for(i=0;i<2;i++)
      {
         //code
      }
    }

    编译通过.

    很郁闷,为什么啊?
    高手请指教!

  • 相关阅读:
    mysql之数据类型以及操作数据表
    mysql之提示符
    神经网络-1
    matlab使用摄像头人脸识别
    使用git和intelliJ
    VS配置使用第三方库
    Qt(1)
    附录:其他相关知识
    附录:python and numpy
    上手Caffe(二)
  • 原文地址:https://www.cnblogs.com/lbk/p/52964.html
Copyright © 2011-2022 走看看