By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,009 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,009 IT Pros & Developers. It's quick & easy.

User input variavle names

P: 51
Is it possible to name a variable user input?

Example.

string x;
x = cin<<"name a variable";
(The user types in "Happy")
Then i could i name a variable "Happy"?
Jun 18 '07 #1
Share this Question
Share on Google+
2 Replies


Savage
Expert 100+
P: 1,764
Is it possible to name a variable user input?

Example.

string x;
x = cin<<"name a variable";
(The user types in "Happy")
Then i could i name a variable "Happy"?
It is possible,but it won't be so simple.You would need to update your source code using other programme and then compile it in command line.Do you know to work with files?

Can I ask you why do you want to do this?




Savage
Jun 18 '07 #2

P: 51
I was thinking about this because i was wondering how they coded arrays in compilers, which lead me to this.

PS: What is the C++ equivalent of python lists.
Jun 25 '07 #3

Post your reply

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