Re: char array and pointer?
From: muchan (usenet_at_usenet.usenet)
Date: 08/13/04
- Next message: thc: "Re: Re: export imported function."
- Previous message: Arnaud Debaene: "Re: Size difference between dll and static library"
- In reply to: Rola: "Re: char array and pointer?"
- Next in thread: Rola: "Re: char array and pointer?"
- Reply: Rola: "Re: char array and pointer?"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 13 Aug 2004 11:56:48 +0200
Rola wrote:
> Hi Tomek,
>
> thank you for your advice, anyway this returns not only one char but all the
> chars from a given pos to the end of array. Am I doing something wrong?
>
> Rola
>
> "TomekG" <tomgas@cntk.pl> wrote in message
> news:O%23saCURgEHA.140@TK2MSFTNGP12.phx.gbl...
>
>>int pos;
>>*(array+pos) => value array[pos]
>>
Probably you missed the presence of '*'.
Here (array+pos) is a pointer to a character, that hold the address.
It may be used as holder of the address, which starts the string,
(that is terminated with char '\0' )
*(array+pos) is the content of the address, pointed by that pointer.
It is one char.
To clear the basic confusion, you should read an introductory text
about C and C++'s pointer, array, and general concept of "address".
muchan
- Next message: thc: "Re: Re: export imported function."
- Previous message: Arnaud Debaene: "Re: Size difference between dll and static library"
- In reply to: Rola: "Re: char array and pointer?"
- Next in thread: Rola: "Re: char array and pointer?"
- Reply: Rola: "Re: char array and pointer?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|