I've never had a problem with files before, but now I can't seem to get it to work properly.
I have this code:
fstream someFile("file.txt");
switch(choice){
case 1:
cout << "Enter date: ";
cin >> date2;
cout << "Month: ";
cin >> month2;
cout << "Year: ";
cin >> year2;
cout << "Enter name: ";
cin >> name;
cout << "Enter any other information: ";
getline(cin, info);
someFile << date2 << " " << month2 << " " << year2 << " " << name << " " << info;
break;
}
When I use getline(cin, info) instead of cin >> info, it doesn't let me input anything when I run the program, and it doesn't create the file.