I can't seem to use the 'cin.get' statement for getting character arrays. I've just switched to VC++ Express, from Dev-Cpp, which allowed that. I have tried other methods like declaring the variable with 'string' but the compiler doesn't recognise it even with the <string> header.
void encrypt()
{
string input; // Error Given: " 'string' : undeclared identifier "
//char input;
char activeChar=0;
int done=0;
std::cout << "enter text (max 64 characters):\n";
//getline (cin, input); // Error Given: " 'getline': identifier not found "
cin.get (input,65); // Error Given: " 'cin' : undeclared identifier "
do
{
input[activeChar]+=1;
activeChar++;
if(input[activeChar]=='\0')
{done=1;}
else
{
if(input[activeChar]==32)
{input[activeChar]=31;}
}
} while (!done);
std::cout << "encrypted: " << input << '\n' << '\n';
}
Basically, I need an alternate to 'cin.get' that uses the 'std::' format, or something else that this compiler will understand.