From: balboa Newsgroups: comp.os.msdos.djgpp Subject: Newbie looking for clarity Date: Wed, 17 Feb 1999 12:19:41 -0500 Organization: UUNET Canada News Transport Lines: 65 Message-ID: <36CAFA2D.DEDDF0BF@castle.on.ca> NNTP-Posting-Host: 209.47.203.66 Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------6DDB104BBC2D8856C63F4C7D" X-Mailer: Mozilla 4.5 [en] (WinNT; U) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com --------------6DDB104BBC2D8856C63F4C7D Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit This a question for clarity. int array_name[10]; If the name of the array array_name points to the address of the first element of the array. array_name[0]; struct item { int value; char name[20]; }; struct item list; Is it the same for this structure, the name list points to the address of first element of the structure? If this is true then list.value is a pointer to the value. struct item *list_ptr; list_ptr = (struct item *) malloc(sizeof(struct item)); Then list_ptr points to the element of the structure in memory. If this is true then list->value is a pointer to the value. Dave --------------6DDB104BBC2D8856C63F4C7D Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit This a question for clarity.

int array_name[10];

If the name of the array array_name points to the address of the first element of the array.

 array_name[0];

struct item
{
 int value;
 char name[20];
};

struct item list;

Is it the same for this structure, the name list points to the address of first element of the structure?

If this is true then list.value is a pointer to the value.

struct item *list_ptr;

list_ptr = (struct item *) malloc(sizeof(struct item));

Then list_ptr points to the element of the structure in memory.

If this is true then list->value is a pointer to the value.

Dave --------------6DDB104BBC2D8856C63F4C7D--