Quantcast
Channel: LabWindows/CVI topics
Viewing all articles
Browse latest Browse all 5339

Variable as string

$
0
0

Dear all,

I have a question for programming  an issue with C/Labwindows  and I need a help if it is possible.

I have consts named : A_0, A_1 and I would like to access to these const automatically. Meanning that I would like to create a const name wich is the result of concatination of the string «A_» with a number. The resulted concatination gives me the name of the const which I can use to access a position of an array for example.

Example : 

Consts which already exisit :

#define A_0 0

#define A_1 1

#define A_2 2

…..

…..

#define A_100 100

 

 

I need to access to these consts automtically.

« A_» concatinated with «0», it gives a string « A_0 ». Then the resulted string « A_0 » will be used as a const which I can use to access an array for example (Array[A_0]=0, Array[A_1]=1,…).

 

I would like to know if there is some ideas to do this feature.

Thank you so much for your answer,

Best regards,

--

Hapiest


Viewing all articles
Browse latest Browse all 5339

Trending Articles



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