converting a variable name to a string in C++

前端 未结 8 993
广开言路
广开言路 2020-12-01 01:15

I\'d like to output some data to a file. For example assume I have two vectors of doubles:

vector data1(10);
vector data2(10); 
         


        
8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-01 02:10

    You can use the preprocessor, there's a stringify token, but it's only available from the source, not to a function (you'd get the argument name).

提交回复
热议问题