想一下,下面的代码片段会输出什么?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <iostream>
class Test
{
public:
    void print() const
    {
        std::cout<<_int<<std::endl;
    }
private:
    static int _int;
};
int Test::_int = 0;
int
main(int argc, char **argv)
{
    Test TArray[10];
    TArray[100].print();
    return 0;
}

  May you note something, anyhow.

Tags: .
你好!除了代码,此处没有多少原创之物,皆为本人搜集、整理、总结之记录与心得,欢迎转载分享!转载时请尽量注明出处,将不胜感激。祝你健康、快乐!
Home

RFC: Request For Comments. Orz..

Name(required)
Mail (required),(will not be published)

RFC: Request For Comments. Orz..

Website(recommended)