hello all, i am a beginner, in C++ we declare varables for example just like(int (variable);. and after this we put some value to variable. but i want that system suppose a variables itself and prompt for a variable just like prompts for value.

Recommended Answers

All 3 Replies

Not able to understand the problem please describe it clearly or with examples.

If you mean that you want the program to prompt for a variable name, you would also want to prompt for the variable type.

You could use a C++ map to hold the (unique) name and a pointer to the (new) memory (allocated) to hold that type (and type name).

yes David W you got it, mean the same. so i need of help by C++ code because i have much understanding with code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.