help on memory question

This is a discussion on help on memory question within the C Programming forums, part of the General Programming Boards category; i'm writing this code in turbo c++ compiler Code: #include<stdio.h> #include<conio.h> void main() { clrscr(); char huge *j; printf("&#37;d",sizeof(j)); getch(); ...

  1. #1
    DESTINY BEN10's Avatar
    Join Date
    Jul 2008
    Location
    in front of my computer
    Posts
    804

    help on memory question

    i'm writing this code in turbo c++ compiler
    Code:
     
    #include<stdio.h>
    #include<conio.h>
    void main()
    {
    clrscr();
    char huge *j;
    printf("&#37;d",sizeof(j));
    getch();
    }
    
    OUTPUT
    4

    what is this 'huge' qualifier.the only thing i know that it is related to memory model.
    plz help soon
    Last edited by BEN10; 07-05-2008 at 01:23 AM.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,424
    Search the Web for "huge pointer".

    Incidentally, if you are new to C, you may want to use a newer compiler and learn standard C instead.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Apr 2008
    Posts
    83

    Hai

    Near Pointer: A near pointer is that which will only point within the current segment say segment 3 (there are S number of segments numbered 0 to S-1) by containing only offset .

    Far Pointer: A far pointer is that which will point anywhere in the X MB across segments by containing segment+offset

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by BEN10 View Post
    i'm writing this code in turbo c++ compiler
    what is this 'huge' qualifier.the only thing i know that it is related to memory model.
    plz help soon
    Straight from the Turbo C/C++ 's IDE:

    huge (type modifier)

    Similar to far type modifier

    <type> huge <pointer-definition> ;

    The huge modifier is similar to the far modifier except for two additional
    features.

    Its segment is normalized during pointer
    arithmetic so that pointer comparisons are
    accurate.

    Huge pointers can be incremented without
    suffering from segment wraparound.


Popular pages Recent additions subscribe to a feed

Similar Threads

  1. heap vs stack memory question
    By donglee in forum C++ Programming
    Replies: 4
    Last Post: 01-23-2009, 03:34 PM
  2. Pointer memory question
    By Edo in forum C++ Programming
    Replies: 5
    Last Post: 01-21-2009, 02:36 AM
  3. Memory question
    By John_L in forum Tech Board
    Replies: 8
    Last Post: 06-02-2008, 10:06 PM
  4. Another Dynamic Memory Question
    By SirCrono6 in forum C++ Programming
    Replies: 6
    Last Post: 03-02-2005, 11:10 AM
  5. Is it necessary to write a specific memory manager ?
    By Morglum in forum Game Programming
    Replies: 18
    Last Post: 07-01-2002, 01:41 PM

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