【发布时间】:2013-12-22 09:47:48
【问题描述】:
我正在尝试这样做:
#include <iostream>
using namespace std;
class smth {
public:
void function1 () { cout<<"before main";}
void function2 () { cout<<"after main";}
};
call function1();
int main ()
{
cout<<" in main";
return 0;
}
call funtion2();
我想收到这条消息: “在主要之前” “主要” “在主要之后”
我该怎么做?
【问题讨论】:
-
为什么要这么做?
-
将
call function1();更改为char call = (function1(), 0);。 -
你能解释一下你为什么要这么做吗?
-
这是一个家庭作业,我只有 std::cout
标签: c++