|
From: Noorez K. <coo...@ho...> - 2004-05-28 13:45:01
|
I have asked questions about pointers and arrays but all the answers are not
that great. Maybe I was unclear so I will explain my questions better...
first...
int main()
{
int nArray[5]={1,2,3,4,5};
cout << nArray << endl;/*this gives the address of the array*/
char sArray[6]={'h','e','l','l','o',\0};
cout << sArray << endl;/*this give the string hello, but i used the name
of the array without subscripts? Don't i get the address of it like in the
int array?*/
char* pszString = "hello";/*strangest of all*/
/*this looks as if you were trying to put "hello" where the address of a
char would go.*/
char String[] = "hello";
char *pszString2 = String;/*looks less confusing because the address of
the array would get assigned to 'pszString2' because of using the name of
the array without a subscript, but still is confusing because cout the name
of the char array without subscripts gives you the string*/
_________________________________________________________________
MSN Premium includes powerful parental controls and get 2 months FREE*
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
|