March 17, 2003
This compiles but does not execute:
//(code has been shortened on purpose)

#include <iostream.h>
#include <string>

string something;

int main()
{

cout << "Enter your name: ";
cin >> something;

}

This compiles and executes properly:

#include <iostream.h>
#include <string>

char something[40];

int main()
{

cout << "Enter your name: ";
cin >> something;

}

Why won't a string work with cin?