Is it possible in c++ to get as an string the name of a variable that was passed as a param?

前端 未结 0 486
心在旅途
心在旅途 2020-11-30 02:12

I will like to be able to do something like this

int myVar = 3;

void logger(int param) {
  std::cout << nameOf(param) << ": " <<          


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题