How do I read in 1000 characters from the console using C++?
UPDATE from comment on answer: “What i want is that the user can input a paragraph ( say 500 or 300 characters)” – i.e. not always 1000 characters
With the following code, I am only able to input up to a limit( around two lines). What am I doing wrong?
#include<iostream.h>
#include<stdio.h>
#include<conio.h>
#include <stdlib.h>
void main()
{
char cptr[1000];
cout<<"Enter :" ;
gets(cptr);
getch();
}
Hope this helps: