Yes, you get the address of the array. But cout etc always assumes that a
pointer to a char is not just a pointer to a single character but actually
a pointer to the first character of a zero-terminated string. cout will
then emit the string.
/Per W
On Thu, 27 May 2004, Noorez Kassam wrote:
> Question with arrays.
>
> When you do something like this
>
> char string[] = "Hello";
> cout << string;
> you get the result Hello.
> I thought that if you used the name of the array with out the reference you
> would get the address of the array?
>
> _________________________________________________________________
> Tired of spam? Get advanced junk mail protection with MSN Premium
> http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: Oracle 10g
> Get certified on the hottest thing ever to hit the market... Oracle 10g.
> Take an Oracle 10g class now, and we'll give you the exam FREE.
> http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|