在c++中如何将传入函数的变量名转成字符串输出?
如下,如果传入ShowList(La),将输出“La的数据为:”;
即如何实现这个toStr()?
void ShowList(LinkList L) {
L = L->next;
cout<<L.toStr()<<"的数据为:”;
while (L)
{
cout << L->data<<' ';
L = L->next;
}
cout << endl;
}