1 #include"stdafx.h" 2 #include3usingnamespace std; 4char *GetMemory(unsignedlong size) 5{ 6char *p=newchar[size];//分配失败,不是返回NULL 7return p; 8} 910int main() 11{ 12try13 { 14char *p=GetMemory(10e11);// 分配失败抛出异常std::bad_alloc 15//...........16if(!p)//徒劳17 cout