Linked List Size Limitation?

This is a discussion on Linked List Size Limitation? within the C Programming forums, part of the General Programming Boards category; I am creating a set of functions that will scan a plain-text file and extract each indavidual word within the ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    8

    Linked List Size Limitation?

    I am creating a set of functions that will scan a plain-text file and extract each indavidual word within the file and place it in a linked list (30 char array) along with a word_id (short int)... though I have the lists working, I have run into a problem, after reading 10,925 words into the list, it just quits... if the file is any longer i get a Null Pointer assignment... so I am wondering if I am running into a list size limitation... any help would be appriciated.

    I am using the Borland C compiler, and I compile under the Large memory model, and I have 384mb of ram. and after reading 10,925 words into the list, sizeof returns a value of 1870069802 bytes for the structure. If you would like to view the code first hand, just ask me and I will post it... Thanks

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,832
    > I am using the Borland C compiler, and I compile under the Large memory model
    Which basically means irrespective of how much real RAM you have, you're limited to the 640K which DOS could originally access.

    Get a compiler suitable for your OS.


    > sizeof returns a value of 1870069802 bytes
    Lemme guess, you used "%d" to print the result?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Feb 2005
    Posts
    8
    lol, yes I did use '%d', and as for the 640k memory limit... that seems right, thx, oh and do you have good c compiler in mind?

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,832
    dev-c++ from www.bloodshed.net is a popular choice.
    Yes, it will compile C as well.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Feb 2005
    Posts
    8
    Ok, thanks a bunch

  6. #6
    Disrupting the universe Mad_guy's Avatar
    Join Date
    Jun 2005
    Posts
    258
    I don't mean to be an ass, but technically Dev-C++ just invokes GCC and G++ on your application accordingly, it's just an IDE. But a very nice and powerful IDE, gotta love a package manager.


    Another suggestion is the C/C++ Digital Mars compiler plus Textpad for an IDE (or Emacs), it's fast, free, and damn small. The main reason I switched over from Dev-C++ to Digital Mars is because the compiler is fast (seriously, Linux users NEED it for compiling their kernels, no joke) and I actually *like* how it does Inline Assembly programming. I am a very shallow person and like nice things, hence I just like doing __asm mov eax,10 rather than __asm("movl $0x10h,%eax");

    The problem with Digital Mars is that it has absolutely HORRIBLE Lib support, and if you want to compile a project using .rc files for Win32 menu's and whatever else, you have to download another small package of executables, so if you wanna do standard things that you could do on pretty much any compiler I suggest Digital Mars and TextPad/Emacs, if you wanna do things like OpenGL or DirectX programming, you're better off just using Devs' package manager to install some libraries rather than go hunt for DM compatable libs...

  7. #7
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    I do mean to be an ass. Let me quote their home page for you:
    Dev-C++ : Free Integrated Development Environment for the C/C++ Mingw compiler (included with the package).
    Therefore it is safe to say that Dev-C++ "compiles". Just like your car "runs". Technically, the car doesn't run at all. It's engine may be said to run, but the car itself doesn't. It just sort of sits there. Hell, it doesn't even run. It doesn't even have legs, let alone feet.

    If you're going to be an ass, it helps if you know what you're talking about.


    Quzah.
    Last edited by quzah; 06-27-2005 at 10:38 PM.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. single linked list to double linked list (help)
    By Countfog in forum C Programming
    Replies: 8
    Last Post: 04-29-2008, 09:04 PM
  2. Replies: 5
    Last Post: 11-04-2006, 06:39 PM
  3. Anyone good with linked list.....I am not....
    By chadsxe in forum C++ Programming
    Replies: 11
    Last Post: 11-10-2005, 02:48 PM
  4. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 11:03 AM
  5. How to use Linked List?
    By MKashlev in forum C++ Programming
    Replies: 4
    Last Post: 08-06-2002, 08:11 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21