每次在 IRC 中显示新文本时显示新行
Every time new text is displayed in IRC display the new line
我正在尝试这样做:
char buffer[256];
while(!buffer.getline){
printf("%s\n",buffer);
}
return 0;
但我无法在缓冲区上使用 getline。
是否有任何其他方法可以做到这一点或可能有使用 getline 的方法?
你必须使用:
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;
}
我正在尝试这样做:
char buffer[256];
while(!buffer.getline){
printf("%s\n",buffer);
}
return 0;
但我无法在缓冲区上使用 getline。
是否有任何其他方法可以做到这一点或可能有使用 getline 的方法?
你必须使用:
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;
}