03
1.
cin输入,如:cin>>nGet
cout输出,如:cout<<nGet
需要iostream.h头文件。
如果是#include <iostream>
就必须在下面写:
using namespace std;
名称空间和命名空间是有一定深度的。
2.
注意换行的区别:
cout<<"HELLO!";
cout<<"HELLO!\n";
cout<<"HELLO!"<<endl;
endl是重起一行的意思。
如果前面没有写using namespace std;而又写成这种形式:#include <iostream>
那么函数就必须要指明命名空间了,如
std::cout<<"HELLO";
std::cout<<"hello"<<std::endl;
利用vax的反汇编来查看!
std::cout<<"hello"<<std::endl;反汇编的时候会发现有两个CALL,其中第二个是调用了操作符。
3.
int i = 0;
int j = 0;
if ( i = 0 )
{
i = i + j;
}
反汇编看下
cdq是清零。
4.题外:中文版的VC++在"build"->"set active configuration"->选项来选择生成DEBUG版本还是RELEASE版本,所以要在工具栏上点右键选择“组建”,这时就有啦!