我试图在C++的功能,可以使一个新的整型变量根据已经在使用std::map
提供了如何使用其他变量声明变量?
为如
void my_variable(char name)
{
int "something here" = 1; // i am figuring out what to write
// there so that it makes a variable from that character that i have sent
cout << "something here";
}
局部变量名只存在于编译时,所以这样的功能将没有用。也许你可以解释你的高层目标? – cdhowie
这是错误的语言,你选择了。 – Griwes
预处理器可以使用##将字符串连接到任何内容。 –