每次在 IRC 中显示新文本时显示新行

Posted

技术标签:

【中文标题】每次在 IRC 中显示新文本时显示新行【英文标题】:Every time new text is displayed in IRC display the new line 【发布时间】:2015-10-18 04:45:09 【问题描述】:

我正在尝试这样做:

char buffer[256];
while(!buffer.getline)
    printf("%s\n",buffer);   

return 0;

但我无法在缓冲区上使用 getline。

有没有其他方法可以做到这一点,或者可能是使用 getline 的方法?

【问题讨论】:

【参考方案1】:

你必须使用:

cin.getline(buffer,256);

所以你的代码将是:

#include <iostream>
using namespace std;
int main()

char buffer[256];
while(cin.getline(buffer,256))
    printf("%s\n",buffer);

return 0;

【讨论】:

以上是关于每次在 IRC 中显示新文本时显示新行的主要内容,如果未能解决你的问题,请参考以下文章

单击按钮时显示网络图像

我希望在选择时显示文本

如何从编辑文本中删除键盘,但单击编辑文本时显示键盘?

从后面的代码更改时显示文本框文本

单击图像时显示文本

在chrome中单击时显示输入类型文本边框[重复]