how could I declare a variable by naming it with another variable. For example.
I want the name of "int x" to be the value of "char* x".
This possible?
how could I declare a variable by naming it with another variable. For example.
I want the name of "int x" to be the value of "char* x".
This possible?
If I get what you mean you can put int x in char *x like so
but if you mean you want to use int x as a variable name you can't because you cant have a space in a variable name and using keywords as variable names is illegal also, you would have to use an underscore: int_x.Code:char *x = "int x";
Why would you want to do this anyway?
All spelling mistakes, syntatical errors and stupid comments are intentional.
No, what I meant was:
char* name = "variable_name";
int name;
//The int is actually called int variable_name
You want to name, or change the name, of a variable AFTER the exe is built?
As far as I know, not possible.
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill
There is a slight possibility tho in DLL's. You may be able to modify the dll without the necessity of compilation afterward. However, if it's a DLL you'd have to modify before declaring the DLL in your program, I think...
But anyway, the real issue here is that this would be a shear novelty program with no use to the developer, really.
You can have a config file to get a value and use this.
ie
in the config file to be loaded and read at runtime
ConfigFile.sText[64]="SomeText";
in a header
#define MY_TEXT ConfigFile.sText
so after the program starts
MY_TEXT = "SomeText"
But this is not what you realy want
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill