I am finally making my first program since I started on C++. It is simple, it basically extracts the first name and last name from the user and then exports it to a text file.
Here's the catch...I don't know how (or if it's possible) to export it to a text file.
Here's the code so far:
//A simple program for finding names.
#include <iostream>
using namespace std;
// Declares two string type variables to store the first name and second name
string firstName
string secondName
//Requests the user to input first name, then last name, then dumps the two into the two variables declard above.
cout <<"Hello there! Please enter your first name:"cin >>firstName
cout <<"Now your second name:"cin >>secondName
//Waits for the user to terminate.
system ("PAUSE");
return 0;
I need to export those two variables to a text file.
Any info would be great.
Thanks
Edited by Hunter100, 13 February 2010 - 12:18 AM.


Sign In
Create Account


Back to top









