Thread: Reading indeterminate length line from file

  1. #31
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >The linked list version is still a little faster.
    What about the dynamic array version? Have you tested this with stdin as the stream or just a file? Do all of the options work with stdin? Which is faster?
    My best code is written with the delete key.

  2. #32
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,663
    You could well find that when reading from a file, that the program you run 2nd is always quicker due to file caching.

  3. #33
    Registered User
    Join Date
    Sep 2003
    Posts
    224
    I haven't checked the dynamic array version, yet.
    I ran the two programs multiple times, and it always turned out that the linked list version was a little faster. Within the program itself, I read from the file, which had about 6000 lines, 10 times times. So the time you saw was actually 10 passes through the file.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 7
    Last Post: 02-02-2009, 07:27 AM
  2. help again with scrolling without wrapping
    By Dukefrukem in forum C Programming
    Replies: 8
    Last Post: 09-21-2007, 12:48 PM
  3. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  4. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM
  5. Greenhand want help!
    By leereg in forum C Programming
    Replies: 6
    Last Post: 01-29-2002, 06:04 AM