C++11 第二章

来源:互联网 发布:巨拟叶螽淘宝 编辑:程序博客网 时间:2024/06/11 12:12

一  C++预定义

1. C++11与C99兼容的宏


#include "stdafx.h"#include <iostream>using namespace std;int _tmain(int argc, _TCHAR* argv[]){//cout<<"Standard Clib"<<__STDC_HOSTED__<<endl;//cout<<"Standard C:"<<__STDC__<<endl;//cout<<"C Standard vision:"<<__STDC_VERSION__<<endl;//cout<<"ISO/IEC"<<__STDC_ISO_10646__<<endl;return 0;}

    在VS2010上,以上均没有定义

2.__func__

基本功能:返回函数的名字。

#include <iostream>#include <string>using namespace std;char *hello () {return __func__;}char *world () {return __func__;}int main(){cout<<hello()<<","<<world()<<endl;//hello,world}
3.long long 整型










0 0