printf("%4d,%12s,%12f,%12x\n",type,lexeme,value,toke)翻译成listbox,怎么写?

daijope 2011-03-26 11:40:09
printf("%4d,%12s,%12f,%12x\n",int,lexeme,value,toke)翻译成listbox,怎么写?int 是int型的,要多列显示,((CListBox*)GetDlgItem(IDC_LIST1))->AddString(token.lexeme);只能显示一列一列的显示,一行不能显示多列,要怎么写啊???
...全文
174 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
daijope 2011-03-26
  • 打赏
  • 举报
回复
还是不行啊。。。。提示:error C2143: syntax error : missing ';' before '.'错误。。
CString str.format("%4d,%12s,%12f,%12x\n",int,lexeme,value,toke);这个到底要怎样写啊。。
l546461042 2011-03-26
  • 打赏
  • 举报
回复
CString str.format("%4d,%12s,%12f,%12x\n",int,lexeme,value,toke);
((CListBox*)GetDlgItem(IDC_LIST1))->AddString(str);
无水先生 2011-03-26
  • 打赏
  • 举报
回复
可以:
CString str.printf("%4d,%12s,%12f,%12x\n",int,lexeme,value,toke);
((CListBox*)GetDlgItem(IDC_LIST1))->AddString(str);
fishion 2011-03-26
  • 打赏
  • 举报
回复
你可以用CListCtrl替换CListBox,也就是用列表控件
daijope 2011-03-26
  • 打赏
  • 举报
回复
CString str;
str.format("%4d,%12s,%12f,%12x",int,lexeme,value,toke);
嗯,这是可以的。。但是里面不能有\n。。感谢了。。
fishion 2011-03-26
  • 打赏
  • 举报
回复
CString str;
str.format("%4d,%12s,%12f,%12x\n",int,lexeme,value,toke);

15,979

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧