|
From: Daniel G. <sp...@ho...> - 2002-04-06 15:37:20
|
Look at the declaration for PName. It is declared as char *PName. The line
cout<<PName; outputs the entire name.
HOWEVER if I declare the variable as char PName (with no *) only the first
letter is outputted.
Can anyone tell me what the * is doing?
Thanks,
Daniel
#include <iostream>
#pragma warning (disable : 4101)
int main(int argc, char* argv[])
{
using namespace std;
char *PName;
cout << "Type passenger name\t";
cin >> PName;
cout << PName;
return 0;
}
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.
|