# include "test.h"
int i = 0;
test :: test(){
}
test :: ~test(){
}
int test::getNumber(){
return i;
}
class test{
public:
int i ;
test();
~test();
int getNumber();
};
// test_2.cpp : Defines the entry point for the console application.
#include <iostream>
#include <string>
#include "test.h"
using namespace std;
int main(int argc, char* argv[])
{
test t;
int s = t.getNumber();
cout << "number is :"<< s << endl;
return 0;
}
各位大侠 这端程序运行完后输出地应该是 0 吧可是为什么输出地是-90922334这样的数字呢我很费解 刚开始研究c++ 问题有些菜哈 大家请赐教~~~