C++读写文件
2020-12-13 13:49
                         标签:std   close   line   while   cstring   namespace   algo   fstream   fst    使用ifstream 然后对C++进行文件的读取 头文件 读取代码段 写入代码段 C++读写文件 标签:std   close   line   while   cstring   namespace   algo   fstream   fst    原文地址:https://www.cnblogs.com/zoey686/p/11539766.html>#includeint main() {
    string buffer, filepath = "test.txt";
    ifstream myfile(filepath.c_str());
    //等同于 ifstream myfile("test.txt");
    while(getline(myfile, buffer)) {
        cout int main() {
    string filepath = "test.txt";
    //ofstream myfile("test.txt");
    ofstream myfile(filepath.c_str());
    myfile 
下一篇:python基础_变量