View Single Post
Old Nov 28th, 2005, 1:04 PM   #7
Magius Avvail
Newbie
 
Magius Avvail's Avatar
 
Join Date: Nov 2005
Posts: 23
Rep Power: 0 Magius Avvail is an unknown quantity at this point
Quote:
Originally Posted by jayme
This one will suite your needs better.. more simple to use as well

#include <iostream.h>
#include <string>
using std::string;

int main()
{
    string mystring; // declare a strings name, much like a variable
    cout << "Enter a string: "; // Normal output, telling the user to input their string
    cin >> mystring; // Input your string 
    cout << mystring << endl; // Print your string to the screen
    system("pause"); // This is just added so that you can see what happened 
}
My compiler doesn't seem to recognize any of the following:

#include <string.h>

#include <string>

or

#include <string>
using std::string;
Magius Avvail is offline   Reply With Quote