报 I 没有定义。
把它改成public class TestClass
{
    /// <summary>
    /// DoWork is a method in the TestClass class.
    /// </summary>
    public static void DoWork(int Int1)
    {
       for(int i=0;i<100;i++)
       {
       }       for(int i=0;i<100;i++)
       {
       }
    }
}就可以了,不知道为什么

解决方案 »

  1.   

    这说明VC6有bug,for()语句内部定义的变量,在循环结束之后i就已经被收回.
      

  2.   

    2005对语法检查更严格了。for()语句内部定义的变量,作用域只在for之内
      

  3.   

    1、在C#中,写一个类或方法时,在方法的上一行写上这样的语句
    public class TestClass
    {
        /// <summary>
        /// DoWork is a method in the TestClass class.
        /// </summary>
        public static void DoWork(int Int1)
        {
        }
    }
    可以使程序在其它模块调用该类的方法时,当鼠标移到该方法时,即可显示<summary>中的内容,这个功能非常实用,在VC++怎么实现?这个问题,在VC++中,真的没有办法了吗?
      

  4.   

    有。
    装Visual Assist,在函数前
    /*
     */
    int fun();
      

  5.   

    装了Visual Assist,还是不显示呀
    我就想实现,在主函数中,把鼠标移到max处,即可显示注释行中的字// abc.cpp : 定义控制台应用程序的入口点。
    //#include "stdafx.h"
    #include <iostream>
    using namespace std;int _tmain(int argc, _TCHAR* argv[])
    {
    int a=5;
    int b=10;
    cout << "Hello world!\n";
    cout << max(a,b);
    std::cin.ignore();
    }/************************************************************************/
    /*作用:返回两个值中较大者 
    /************************************************************************/int max(int a,int b)
    {
    if (a > b)
    {
    return a;
    }
    else
    {
    return b;
    }
    }
      

  6.   


       return a>b?a:b;   //    
      

  7.   

    1 VC 6 IDE尚无此功能,请尝试使用VS2008.NET的VC++.NET
    2 VS2005的一些变量作用域规则变了。
      

  8.   

    [email protected]
    发一份,谢谢
      

  9.   

    [email protected]
    我也要一份,