0
How can I make the user to enter a specific name so that name become my variable's identifier ?
C++ identifiers
4 odpowiedzi
+ 2
It is not possible.
+ 1
Making self-modifying code is almost always considered bad practice. However, if it makes sense for you to explore the idea, then consider having your program modify the text of its source code file(s). This idea is called a program generator - i.e. a program that generates source code according to given parameters. Taking the idea further, it can be used to multiply your coding productivity. That's about as close as you can get to implement your request.
+ 1
Though I have written code generators, I no longer have access to those sources. They are with former employers. Feel free to innovate. You can use RegEx to search and replace patterns in code template files. I observed in the 2000's that a book or two were published on the subject. Also I believe commercial software exists for the purpose. Try Google.
0
Brain can you give me a code for this ?