Answer to Question #14917 in C++ for David Wesson

Question #14917
how do you read a line from standard i/o into buffer, a char array?
1
Expert's answer
2012-09-14T10:30:41-0400
#include <stdio.h>

#include <conio.h>
#include <iostream>
using namespace std;

int main(){
char buffer[100];
cout<<"Reading into an array of characters to enter\n";
gets(buffer); &
printf("%s",buffer);
cout<<"\n";
system("PAUSE");
&
}
&

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS