Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with naming a txt!
#9
wut is your ide btw?
visual studio, qt creator, codeblcocks (etc)

anyways I am at school and I dont have my programming companion (qt creator) with me put fire this up and tell me if it works. this will support a CL interface, so make a new "console C++ application".. from here it is very easy to port it to a GUI with an inputbox and button
Code:
#include <iostream>
  #include <fstream>
  using namespace std;
  int main () {
  ofstream myfile;
  int filename;
  cout << "Please enter a text file name: ";
  cin >> filename;
  cout << "text file " << filename;
  myfile.open (filename);
  myfile << "Writing this to a file.\n";
  myfile.close();
  return 0;
}
slowly getting better
Reply


Messages In This Thread
Help with naming a txt! - by Dr.BrokenGod - 07-01-2011, 09:15 AM
RE: Help with naming a txt! - by 0xE9 - 07-01-2011, 09:57 AM
RE: Help with naming a txt! - by Dr.BrokenGod - 07-01-2011, 10:05 AM
RE: Help with naming a txt! - by Kyle FYI™ - 07-01-2011, 12:59 PM
RE: Help with naming a txt! - by ★ASI_F★™ - 07-01-2011, 10:01 AM
RE: Help with naming a txt! - by Dr.BrokenGod - 07-01-2011, 01:20 PM
RE: Help with naming a txt! - by haphazard - 09-14-2011, 07:49 PM
RE: Help with naming a txt! - by Godly™ - 09-14-2011, 07:50 PM
RE: Help with naming a txt! - by haphazard - 09-14-2011, 07:55 PM
RE: Help with naming a txt! - by hacker - 09-14-2011, 08:36 PM
RE: Help with naming a txt! - by +Awesome - 09-18-2011, 01:52 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)