求解!!!!!!!
- C/C++ code
#include <iostream> using namespace std;class boolit{public: void setword(char w) { word=w; } void print() { cout<<word; } private: char word; };int main(){ boolit b1; b1.setword('a'); b1.print(); system("pause"); return 0;}
程序应该是没有错的!!
但是运行不了!!!
[解决办法]
程序本身没有问题,原因在于你用的是WIN32工程模式,这样默认的主函数的WinMain而不是main,重新建立控制台工程即可。