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

static内部とclassは、問題のメンバーまたはメソッドがオブジェクトを操作しないことを意味します。つまり、を定義しませんthisが、クラスの名前空間にあります。

staticクラスの外部とは、Cでの意味を意味します。変数または関数には外部リンクがありません。つまり、現在のコンパイルユニットの外部にあるものはそれにリンクできません。

2つのまったく異なるもの。

于 2010-11-03T04:13:39.007 に答える
0

問題があったかどうかはわかりません。今は正常に動作します。デバッグ中に最初に発生しました。次に、デバッグの代わりに実行しただけで、うまくいきました。次に、もう一度デバッグを試みましたが、今回はうまくいきました。

于 2010-11-03T04:51:49.300 に答える