You might want to try understanding how to access different fields of a
structure.
Every structure can be visualized like a block of memory and accessing
fields is like
accessing the block at different offsets depending on the sizes of the
fields.
Hence ..
typedef struct { *char **ch;
*int* id;
*float* salary;
} Base;
Base orgin;
origin + 0 (Start Address) point to the first element (char *ch)
origin + (sizeof char *) points to the second element in the block (int
id)
origin + (sizeof char *) + (sizeof int) points to the third element (float
salary)
Regards,
Santosh.
--
On 12/22/06, tamilselvan balan <[EMAIL PROTECTED]> wrote:
Hi Friends,
Can any body tell me how to access the structure elements without
using the elements name.
(e.g)
typedef struct {
*char **ch;
*int* id;
*float* salary;
} Base;
Base orgin;
*orgin + 0 * point to the first element of Base ( ch )
*orgin +1* point to second element of Base (id)
*orgin + 2* point to Third element of Base ( salary)
Is it possible to access the elements like this , if yes please let me to
know
Thanks&Regards,
Selvan.
Send free SMS to your Friends on Mobile from your Yahoo! Messenger.
Download Now! http://messenger.yahoo.com/download.php
--
Santosh Vernekar
Sr. Dev. Engineer
Calsoft PVT. LTD.
# Linux: Because rebooting is only for adding new hardware.
# Failure is not an option -- it comes bundled with Windows.