473,468 Members | 1,531 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

access computed variable name

4 New Member
Hi,

I have a variable's name stored in a character string:

char* a = "access_me";

How can I access this variable? Let's say access_me is also of type char* and I want to have functionality of:

printf("%s", access_me);

Thanks.
Jul 15 '07 #1
3 1182
Meetee
931 Recognized Expert Moderator Contributor
Hi,

I have a variable's name stored in a character string:

char* a = "access_me";

How can I access this variable? Let's say access_me is also of type char* and I want to have functionality of:

printf("%s", access_me);

Thanks.
You can write it as
printf("%s", a); and it will print access_me.

Regards

PS Hope I have understood your problem correcty!
Jul 16 '07 #2
ccodehelp
4 New Member
You can write it as
printf("%s", a); and it will print access_me.

Regards

PS Hope I have understood your problem correcty!
I over-simplified my porblem perhaps and of course this is correct. But what I intended actually was:

I have 'access' stored in char* a. I want to access a variable name constructed from it. like I am appending _func to all these variables, I actually want to access access_func.
Jul 16 '07 #3
weaknessforcats
9,208 Recognized Expert Moderator Expert
have 'access' stored in char* a. I want to access a variable name constructed from it. like I am appending _func to all these variables, I actually want to access access_func.
There is no access to the variable name at run time. Everything has been converted to binary. You can't even tell what language the program wwas written in.
Jul 16 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Ruud de Jong | last post by:
I have the situation where I need to construct the name of a static method, and then retrieve the corresponding function from a class object. I thought I could just use __getattribute__ for this...
9
by: DMAC | last post by:
If i want to split a computed column into two or more columns based on the the length (its a varchar) of the computed column, how often will sql server determine what the computed column is?...
4
by: coolsti | last post by:
I have been playing around with this task for some hours now, and can't seem to find a way. I have an assortment of buttons on a web page, which have their background colors defined via style...
166
by: Graham | last post by:
This has to do with class variables and instances variables. Given the following: <code> class _class: var = 0 #rest of the class
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
0
by: Jim Heavey | last post by:
Hello, I have created a computed column which concatenates a name and date. My problem is that if the 10 is not 10 characters, I get an extra character placed into the computed column. Here is the...
2
by: Dot Net Daddy | last post by:
Hello, I want to assign a column a computed value, which is the multiplication of a value from the table within and a value from another table. How can I do that?
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
6
by: Adam Donahue | last post by:
As an exercise I'm attempting to write a metaclass that causes an exception to be thrown whenever a user tries to access 'attributes' (in the traditional sense) via a direct reference. Consider:...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.