|
From: <pr...@le...> - 2003-04-01 05:56:10
|
Thanks Dany. But doesn't this limit my code in some manner? I've been
brought to believe that strings are better than chars since they
automatically adjust to the size of the input.
Regards,
Pranav Negandhi
This email is a natural product. The slight variations in spelling and
grammar enhance its individual character and beauty and are in no
way considered to be flaws or defects.
<snip>
The best thing is to use a char array. Try this one:
#include <iostream>
#include <string>
using namespace std;
int main()
{
char cName[80];
cout << "Enter some words\n";
cin.getline(cName,80);
cout << "The word is " << cName << endl;
system("pause");
}
<snip>
|