如何在c ++中的Windows窗体应用程序标签中打印节点数据(即:curr-> room)
我的节点包含字符串的'time'和'room'变量
bool found = false;
node* curr = l.first;
while (curr != 0)
{
if (curr->course == "$")
{
found = true;
cout << "Time: " << curr->time << endl;
cout << "Room: " << curr->room << endl;
cout << endl;
}
curr = curr->next;
}
if (found == false)
out->Text = "No Free Slots Found!";
}
答案 0 :(得分:0)
您需要向我们提供有关您的应用程序的更多信息,以便能够正确地帮助您。
在Winforms中,就像大多数其他类型一样,Label控件具有Text属性。要在标签中显示您的Node数据,请创建一个字符串并将标签的文本设置为该字符串:
myLabel.Text = string.Format("Time: {0} Room: {1}", curr->time, curr->room);