所以这是一个非常基本的问题和超级微不足道的,但我只是通过编程原则&实践在c + +和我的程序阅读一个字符串和一个int是行为不同于Bjarne Stroustrup写的书,所以id很惊讶如果他犯了一个错误。反正这里的代码: #include "..\std_lib_facilities.h"
int main()
{
cout << "Please enter your first
考虑: int f() {
static int i = 0;
return i++;
}
struct Test {
int a, b;
Test() : a(f()), b(f()) {}
};
Test t;
我知道a是b之前,由于其在struct声明的顺序初始化。 我也知道f在g(f(), f())的两个调用是不确定的。 所以我想知道