Click here to Skip to main content
15,607,633 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to write a C code that reads billions of integers from a text file. Each integer is of length 10 digits (e.g. -2311872000). then I build a linked list to store these could I do that ?
Updated 25-Oct-13 4:49am
W Balboos, GHB 25-Oct-13 8:10am    
First, find out the data-block capacity of your system (4GB per billion reads, minimum); Also, be certain that you can create an index offset of sufficient size for the number of values you plan to read. The text file, itself, would seem to be rather large, as well (up to 10GB/billion values) - does it already exist or are you only planning on this exercise.

A 64-bit O/S (or more) would be a good idea about now.

1 solution

Apart of the crazy resource-consuming requirements (every 'billion' of integers translates to, at least, 4 GB of memory), what is the purpose of storing the integers in a linked list?
In any case, the bulk of your task is relatively simple, build a linked list (see, for instance "C Linked List Data Structure Explained with an Example C Program"[^] and store the read integers in.
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900