RE: [Dev-C++] Stress with structs and pointers.
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: David M. <ci...@ya...> - 2003-06-12 15:05:14
|
Ok. Now to apply this stuff and hope I don't crash this MUD
again :P. BTW I apoligize if I came across as a newbie who
did not RTM. All I really needed was #4. The first 3 were
to make sure I had my prior facts straight.
--- Ioannis Vranos <iv...@em...> wrote:
>
>
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On
> Behalf Of David McKen
> Sent: Thursday, June 12, 2003 3:16 AM
> To: dev...@li...
> Subject: [Dev-C++] Stress with structs and pointers.
>
>
> Ok, I need some clarification on a couple topics
> invloving pointers and
> pointers.
>
> 1) when a struct is created. All that can be assumed is
> that it contains
> trash right? What is a portable way to initalize
> everything to 0? mset?
>
>
> struct whatever_type s={0, 0, 0 ...};
>
>
> 2) when a structure contains a pointer. Access to the
> address (not the
> value) comes in the form
> {struct_variable_name}.{member_name}?
>
>
> Yes.
>
>
> 3) how do you de-refrence the pointer in #2 to get the
> value of the
> variable? {struct_variable_name}.*{member_name}?
>
>
> *struct_variable_name.pointer_name=...
>
> or
>
> *(struct_variable_name.pointer_name)=...
>
>
> to make it easier to understand. I use the second.
>
>
>
> 4) if you have a pointer to the structure you access the
> members via '->'.
> If a member of the structure is a pointer the address is
> gotten via
> {struct_varible_name}->{member_name}?
>
>
> Yes
>
>
> If so how does one get the value of the varible?
> {struct_variable_name}->*{member_name}?
>
>
>
> *struct_variable_name->pointer_name=...
>
>
>
> Ioannis Vranos
>
> * Programming pages: http://www.noicys.freeurl.com
> <http://www.noicys.freeurl.com/>
> * Alternative URL 1: http://run.to/noicys
> * Alternative URL 2: http://www.noicys.cjb.net
> <http://www.noicys.cjb.net/>
>
>
>
=====
Signed
David Mcken
Life Sucks
Live with it
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
|