Is there an infinitely large integer file. I am writing a program that processes large files, and I need to make an infinitewly large array. How do I do this?
thanks
Is there an infinitely large integer file. I am writing a program that processes large files, and I need to make an infinitewly large array. How do I do this?
thanks
Dmitry Kashlev
>I need to make an infinitewly large array
You can't do this because of memory constraints.
>I am writing a program that processes large files
I doubt that you have to process the entire file in memory all at once. Read a block of the file and process it, then save that block to disk and read another. Lather, rinse, repeat until the file has been completely processed.
-Prelude
My best code is written with the delete key.
your idea is fine, but i need infinitely large integer because I am calculating the total number of nonnumerical values in each column of data (a 100MB file), and then replace those nonnumerical values with numbers in the order of their sequence in the array.
Dmitry Kashlev
read it in in blocks, and use multiple integers. unsigned long long's work pretty good ... the range has to be in the trillions at least.
try doubles
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
max for unsigned long long is 18446744073709551615... i hope you realise how large that number is... hehe...
what about signed long? How I initialize only positive longs?
Dmitry Kashlev
What you're talking about is arbitrary precision arithmetic. You define your own number using either linked lists or an array so that you can have a huge precision in your calculation or you can use enormous numbers. Like if you're using an array, you can have a portable number up to 32,767 digits. But I imagine that for your problem a double would work fine.i need infinitely large integer
Simple, just declare it as unsigned.How I initialize only positive longs?
unsigned long num;