Hi befor you start flaming me about my other one, for some reason it doesnt work at all, not my fult, but I need help on my code a little. I want it to ask what the file the user want to name the txt file, but I cant get that half to work right for some reason.
I know I need the input but I never had to put something behind it from my work with input. This is not homework btw, i'm just trying out new codes.Code:#include <iostream> #include <fstream> using namespace std; int main () { char infor [1000]; char name [100]; cout<<"What is the name of the file? "; cin.getline (name,100); ofstream myfile; myfile.open ("name.txt"); //<~~here cout<<"Please enter what to save: "; cin.getline (infor,1000); myfile << infor; myfile.close(); return 0; }