1. check if the x'th year is reached
2. gather his information somehow(you didnt tell) and save it into a string vector
3. use fstream header apis to create a file, a file stream and then write to it
e.g.
PHP Code:
int main(void)
{
if(!NthYearIsReached())
return 0;
std::vector<string> info;
[...] //collect info with push_back()
//output the vector with a range for to check if it saved everything
[...] // for(auto elem : info) {...}
//if everything is correct
fstream file;
file.open("TouristInfo.txt", fstream::out);
for(auto elem : info)
{
file << elem << std::endl;
}
file.close();
return 0;
}