Results 1 to 3 of 3

Thread: C programmers, check this out

Hybrid View

  1. #1
    Guest

    C programmers, check this out


  2. #2
    Moderator
    Advisor
    redhead's Avatar
    Join Date
    Jun 2001
    Location
    Copenhagen, Denmark
    Posts
    811

    Re: C programmers, check this out

    That all sounds very good, but what if you're working with dynamicaly growing arrays, would this try to estimate the size of them ? or create some sort of double linked list to workaround the malloc(), calloc() and realloc() calls..

  3. #3

    Re: C programmers, check this out


    That all sounds very good, but what if you're working with dynamicaly growing arrays, would this try to estimate the size of them ? or create some sort of double linked list to workaround the malloc(), calloc() and realloc() calls..
    That's not what it does. If you have any assembly experience, you probably know that most compilers allocate memory in the order it is presented in the code. The thing with stack smashing comes from code like this:
    Code:
    char x[10];
    int * y;
    x[11]=12; // y now points to memory location 12
    Basically, this extension reorders the memory so it looks like this:
    Code:
    int * y;
    char x[10];
    x[11]=12;
    This way, if more memory is addressed than there is allocated, you do not have to worry about pointers being messed with.

Similar Threads

  1. C Programmers Help !
    By marks in forum Windows - General Topics
    Replies: 0
    Last Post: 08-19-2007, 09:15 PM
  2. IT students not want to be programmers then what?
    By tech291083 in forum Linux - General Topics
    Replies: 2
    Last Post: 03-31-2007, 09:59 AM
  3. Verizon switches programmers to Linux
    By trickster in forum General Chat
    Replies: 11
    Last Post: 08-20-2002, 09:57 PM
  4. This board needs more programmers
    By in forum Linux - Software, Applications & Programming
    Replies: 15
    Last Post: 03-05-2002, 07:45 PM
  5. check out....
    By creedon in forum General Chat
    Replies: 8
    Last Post: 02-25-2002, 11:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •