In C++, how does one rename a variable midway through a block? References and macros feel wrong.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t.
But you can make a reference to it and access it under different “name”.
If you really don’t like the variable, just go out of current block, return from the function, leave the block.