Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

Extract variable name from string in Visual C++

$
0
0

In my program, I have a struct similar to the following:

public struct switchStruct{char nextSwitch [7];
int randomNumber;
};

What I am trying to do is create a struct instance named currentSwitch for use in a while loop.  I would like the currentSwitch.nextSwitch to be able to point to the randomNumber field in the next switch.  The pseudocode would like the following:

(currentSwitch.nextSwitch).randomNumber

In other words, say the current switch is switchB, with a nextSwitch value of 'switchC'.  I want the code to be able to take 'switchC' and be able to retrieve the value of switchC.randomNumber.

Is this possible?  I am using Visual C++ with CLR.  This part of the code would be in a form header file.

Thanks!


Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>