Hi there,
i have writing program which takes file name(full path) and do some modification on these file.
Assuming we have a file that ready to work.
file.txt:
name id age
name id age
name id age
name id age
if i wanna change the id to specific string what function should i use?
Code:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(){
ifstream file("file.txt");
string buffer;
getline(file, buffer);
/*
Here i will change buffer's content to do( modification )
*/
cout<<buffer<<endl; // print out our new data
file.close();
return 0;
}