所谓static对象,其寿命从被构造出来直到程序结束为止,因此stack和heap-based对象都被排除。这种对象包括global对象,定义于namespace作用域内的对象、在class内、在函数内、以及在file作用域内被声明为static的对象。函数内的static对象称为local static对象(因为它们对函数而言是local),其他static对象称为non-local&
#include "stdafx.h" #include "stdio.h" #include "Windows.h" #include "iostream" using namespace std; #define Num 10000000 // 一千万 class Student { private: string m_strName; int m_iAge; public: St
#include<iostream> using namespace std; #define max(a,b) (((a)>(b)? (a):(b))) int main() { int a=10; int b=0; int c=max(++a,++b); cout<<"a:"<<a<<" b:"<<b<<" c:
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号