does not continue reading input from the user !!?

When i run this program by input 50000, the output stops at 633 instead of 50000, Why and How to fix it !??

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
int main()
{

 
    long int n;
    cin>>n;

    long double* r = new long double[n];


    for(long int i=0;i<n;i++)
    {
        cin>>r[i];
        cout<<i<<"  "<<r[i]<< endl;
    }
 
    return 0;
}
Last edited on
you planned on testing it by inputting 50k numbers manually?



When i run this program by input 50000, the output stops at 633 instead of 50000, Why and How to fix it !??


i test it by replacing line 13 to r[i] = i;

it works, it prints 50k numbers. i think you just mistyped the input to another type except numbers
but i am sure that the input are numbers ,but big numbers, so how can i fix it ??
Last edited on
but big numbers

it should work as well, long double can handle any decimal length

so how can i fix it ?? 

i dont know if it works to me, wait your answers here
http://stackoverflow.com/questions/29876899/does-not-continue-reading-input-from-the-user
Is the program terminated when the output stops? I have noticed that sometimes a program will freeze when outputting a lot, especially when the output window has lost focus, but I think it starts again when the window regains focus. Could that be it? Maybe it works better if you redirect the output to a file.

you planned on testing it by inputting 50k numbers manually?

Maybe he reads the input from a file.
Last edited on
Topic archived. No new replies allowed.