By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,972 Members | 855 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

refering struct members

P: n/a
Hello,

my question: In case i use the following structs:

struct odt_entry_size {
unsigned short address;
unsigned int size;};

struct no_of_odt_entries {
struct odt_entry_size odt_entry [8];};

struct no_of_odt_entires daq_list[4];

can i access the member address as below ?

daq_list[1].odt_entry[3].address

if am wrong how can this be done?

thanks in advance for the response,

Sep 16 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
sa****@lycos.co.uk wrote:
Hello,

my question: In case i use the following structs:

struct odt_entry_size {
unsigned short address;
unsigned int size;};

struct no_of_odt_entries {
struct odt_entry_size odt_entry [8];};

struct no_of_odt_entires daq_list[4];
I assume here you meant entries rather than entires.
>
can i access the member address as below ?

daq_list[1].odt_entry[3].address
If you fix the typo then it's correct.

Sep 16 '06 #2

P: n/a
sa****@lycos.co.uk wrote:
my question: In case i use the following structs:

struct odt_entry_size {
unsigned short address;
unsigned int size;};

struct no_of_odt_entries {
struct odt_entry_size odt_entry [8];};

struct no_of_odt_entires daq_list[4];

can i access the member address as below ?

daq_list[1].odt_entry[3].address
As noted by "dev", there is a typo. I suggest you get a C compiler, if
you don't have one, and run sample code through it. You can answer a
lot of questions that way. One hazard with that, though, is that some
compilers have extensions that accept constructs outside the standard
language. Using these makes code non-portable to other compilers and hosts.

--
Thad
Sep 16 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.