3

在头文件中有一个静态函数

    class Diagnostics {
    public:


    static void functionA(){
    }

    static void functionB(){
    some code //works fine until enters the loop below
    variable_name // works fine here.
    if (condition){ // 
    variable_name; // after condition is met , i step in here, debugger cannot examine
                   // the vairable_name which was fine above. right after i try to step                      over , i get SIGSEV error
    some_code; // doesnt even come here. Process exited with SIGSEV
    function C(); // tried using classname::functionC , didnt work either

        }
    }

static void functionC(){
}
4

2 回答 2

4

staticinside aclass表示所讨论的成员或方法不对对象进行操作,即它没有定义this,但它仍然在类的命名空间中。

static类外的意思是它在 C 中的含义:变量或函数没有外部链接,即当前编译单元之外的东西不能链接到它。

两种完全不同的东西。

于 2010-11-03T04:13:39.007 回答
0

我不知道问题是什么。现在工作正常。最初发生在我调试时。然后我只是执行而不是调试,工作正常。然后我再次尝试调试,这次效果很好。

于 2010-11-03T04:51:49.300 回答