Re: Simple Array question - Newbie
From: Fantius (kjhkahask_at_dsjfdjsfh.com)
Date: 08/03/04
- Next message: Chris \( Val \): "Re: Simple Array question - Newbie"
- Previous message: Chris \( Val \): "Re: Catching exceptions thrown from base class constructors?"
- Maybe in reply to: Stephen Tyndall: "Re: Simple Array question - Newbie"
- Next in thread: Chris \( Val \): "Re: Simple Array question - Newbie"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 2 Aug 2004 23:00:05 -0400
Did you expect just to see the output, "h"? The point that you might be
missing is that it is outputing all characters until it finds a chr(0), or
null character, which marks the end of the string.
<TJ> wrote in message news:k96tg09gerftjfa4541rklpvqr7iml77up@4ax.com...
> Hi,
>
> I read somewhere where it says if i declare an array this way:
>
> char greeting[]="hello";
>
> Then, referring to the array as greeting only from the code, will
> imply the address of the first element in the array.
>
> Shouldn't that produce the address of the first element if i do
> cout<<greeting;
>
> I tried that, but it produced the word hello out on the screen.
>
> I am confused on that. Will appreciate some help.
>
> Thanks,
>
> TJ
- Next message: Chris \( Val \): "Re: Simple Array question - Newbie"
- Previous message: Chris \( Val \): "Re: Catching exceptions thrown from base class constructors?"
- Maybe in reply to: Stephen Tyndall: "Re: Simple Array question - Newbie"
- Next in thread: Chris \( Val \): "Re: Simple Array question - Newbie"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|