int write()
{
system("cls");
char text[2000];
char thing[100];
cout << "which file would you like to write to?";
cin.getline (thing, 100);
cout << "what would you like to write? (up to two thousand characters)";
cin.getline (text, 20000);
ofstream file;
file.open(thing);
file<<text;
file.close();
system("pause");
return haha();
}
ok so I'm writing a program that can write to a file and read a file from cmd prompt, not anything i can sell but im a bit of a beginner and i thought this would be a good program to write to use fstream which i just learned and iostream which i learned first. haha() is a function i wrote that is basically a crossroads function, it directs the user to wherever they want to go. now my problem is that whenever i run the file it just charges through the cin.getline's, it comes up with both of them at the same time and whatever the user types in goes to both of them which isnt very useful. please help, what did i do wrong? if you need more of my program tell me