How to access symbol when its dimensionality is not known till runtime (About to giveup)

  • Thread starter Christopher M. Lusardi
  • Start date
C

Christopher M. Lusardi

Hi,

Is it possible to access the actual value of a symbol at runtime when
you don't know it's definition till then. The symbol can be a variable,
a 1 dimensional array, a 2 dimensional array, or a 3 dimensional array?

If this is possible can you post example code for each case.

(Background: The compiler complains if I just use pointers with nested "if"
statements complaining 3 of the 4 assignments are not defined [identifier
is undefined]. I'm using this code on SGI machines and object code doesn't
contain dimensionality information, only the number of elements [obtained
through the system command dwarfdump on the object code].)

Thank you,
Christopher Lusardi
 
G

Gianni Mariani

Christopher said:
Hi,

Is it possible to access the actual value of a symbol at runtime when
you don't know it's definition till then. The symbol can be a variable,
a 1 dimensional array, a 2 dimensional array, or a 3 dimensional array?

If this is possible can you post example code for each case.

(Background: The compiler complains if I just use pointers with nested "if"
statements complaining 3 of the 4 assignments are not defined [identifier
is undefined]. I'm using this code on SGI machines and object code doesn't
contain dimensionality information, only the number of elements [obtained
through the system command dwarfdump on the object code].)

Is this C or C++ ?

If you are using C, there are other ways to do what (I think) you're
trying to do.

Don't let us guess, what exactly are you trying to do ? There may be a
standards compliant way to do it.
 
T

Thomas Matthews

Christopher said:
Hi,

Is it possible to access the actual value of a symbol at runtime when
you don't know it's definition till then. The symbol can be a variable,
a 1 dimensional array, a 2 dimensional array, or a 3 dimensional array?

If this is possible can you post example code for each case.

(Background: The compiler complains if I just use pointers with nested "if"
statements complaining 3 of the 4 assignments are not defined [identifier
is undefined]. I'm using this code on SGI machines and object code doesn't
contain dimensionality information, only the number of elements [obtained
through the system command dwarfdump on the object code].)

Thank you,
Christopher Lusardi

This a FAQ:
http://www.parashift.com/c++-faq-lite/freestore-mgmt.html


--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top