Hi, can anyone please tell me how to create a array of 20 crore (200000000) elements.
I tried, but getting runtime error, might be that much memory is not available.
A crore == 10M, right? lahk == 10K as I recall... :-) An array of 200M elements (assuming array of pointers pointers) on a 64-bit machine will take 200Mx8 bytes (minimum) of memory, which is 1.6GB. Most systems won't allow you to allocate such sizes on the stack, so you … Read More
> Please tell me how to optimise. Delete the printf() line. I/O constitutes some of the most, if not *the* most time intensive operations. On a side note, your code exhibits undefined behavior by accessing uninitialized memory. There's no guarantee that the program *won't* crash intermittently. Read More
Edited by deceptikon