Hey everyone,
I'm trying to make files by what user has input. my code makes files but it doesn't have an extension like, .txt .dat or whatever.
can you please help what should I do here.
It would be much easier if you used a std::string in place of the character array then on line 16 all you would have to do is ofstream fout (name + ".txt");.
From C++11 standards on you can use a std::string for the file name.
You would also have to include "<string>" header file and change line 7 to std::string name;.
Personally I prefer Visual Studio but it's a bit complicated, especially the templates are too sophisticated for beginners. Other IDEs are Code::Blocks, CodeLite or C++Builder Starter.