随笔分类 - C/C++
摘要:class Number { int number; public: explicit Number(int n){number = n;} operator int() //注意一定不能声明返回值 { return number; } }; int main () { ...
阅读全文
摘要:-------------------------------------------------------------------------------------------- --------------------------------------------------------------------------------------------运行结果:1 2 3 ...
阅读全文
摘要:string mystr="100"; float price=200; stringstream(mystr) >> price;
阅读全文
摘要:ifstream in("STLExtension.h",ios::ate); if (in.is_open()) { cout << "file length is " << in.tellg() << endl; }
阅读全文
摘要:#include <iostream>using namespace std;class Base {public: Base() { cout << "In Base" << endl; cout << "Virtual Pointer = " << (int*)this << endl; cout << "Ad...
阅读全文
摘要:malloccalloc,初始化每个元素都为0realloc 重新分配新的地址,将旧地址拷贝到新地址里
阅读全文
摘要:http://melkov.narod.ru/misc/stl-fix/
阅读全文

浙公网安备 33010602011771号