soln7_1.cpp
来自「Visual C++ 2005的源代码」· C++ 代码 · 共 34 行
CPP
34 行
// Soln7_1.cpp
#include <iostream> // For stream input/output
using std::cout;
using std::endl;
struct Sample
{
int one;
int two;
};
int main()
{
Sample a;
Sample b;
a.one = 1;
a.two = 2;
b.one = b.two = 9999;
cout << "a=(" << a.one << "," << a.two << ")" << endl;
// b contains values 9999
cout << "b=(" << b.one << "," << b.two << ")" << endl;
b = a;
cout << "After assigning a to b:" << endl;
cout << "b=(" << b.one << "," << b.two << ")" << endl;
return 0;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?