赞
踩
-
- #include<iostream>
- #include<typeinfo>
-
- using namespace std;
-
- int main()
- {
-
-
- int arr[] = {14,15,7,2,4,78};
-
-
- decltype(arr) newArr;
- cout << "sizeof newArr " << sizeof newArr << " typeid " << typeid(newArr).name() << endl;
-
- for(j=0; j<n;j++)
- {
- cout <<" newArr["<< j <<"] "<< newArr[j]<<endl;
- }
-
- return 0;
-
- }
-
-
- //直接使用常规编译会报错的
- $ g++ -o Demo Demo.cpp
-
- //需要需要c++11选项编译
- $ g++ -std=c++11 your_file.cpp -o your_program
- or
- $ g++ -std=c++0x your_file.cpp -o your_program
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。