1.向文件写数据 头文件#include <ofstream> ①Create an instance of ofstream(创建ofstream实例) ②Open the file with open() or ofstreamconstructor (用open()或者构造函数打开文件) ③Writedata to the file with "<<" (用流插入运算符写数据) ④Close the file (explicitly close()) (显…
format 参数输出的格式,定义格式为 %[flags][width][.precision][length]specifier specifier在最后面.定义了数据类型. Where the specifier character at the end is the most significant component, since it defines the type and the interpretation of its corresponding argument: speci…