C++ Prime Plus总结
cout<<dec<<hexoct;//进制使用方法strcpy( dest , source ); //copy source to dest strchr( "wqst", (char)a); //获取a在字符串中的位置ifstream fin( "test.txt" ); if( ! fin.is_open() ) exit(EXIT_FAILURE);//#头文件stdlibios_base::fmtflags initial; initial = cout.setf(ios_base::fixed); ......//输出到流 cout.setf(initial);//恢复原状态const double* x; decltype (x) y;//const double\* y const double f(int a); decltype ( f(1) ) y;//const double y decltype ( ( f(1) ) ) y;//const double & ycout.width(12);//只影响下一个 cout.fill('-');//设置填充字符 cout.setf(ios_base::showpoint); cout.precision(8); cout << setw(10);//头文件iomainip中,同样只影响下一个ios_base::in;//打开,读取 ios_base::out;//打开,写入 ios_base::ate;//打开,指针移至文件尾 ios_base::app;//只将数据追加到文件尾 ios_base::trunc;//若已有文件则截短 ios_base::binary;//二进制文件 ofstream fout("t.txt", ios_base::out | ios_base::app);char* tmpnam(char* pszName);//头文件cstdio中
Last updated