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;