CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2002
    Posts
    2

    Using huge pointer in C++

    i have a function like "GetExactMatrix(int(huge *buf_x)[250])" in older version of DOS compiler (C600). When i am trying to use the same in in C++ compiler it's not accepting the "huge *". I need a help that how can i use the same thing in C++.

  2. #2
    Join Date
    May 2002
    Location
    Manchester, UK
    Posts
    105
    I don't think you need to worry about specifiying a 'huge' pointer any more. Try removing it from the function header.

  3. #3
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Using huge pointer in C++

    Originally posted by sam_sun_401
    i have a function like "GetExactMatrix(int(huge *buf_x)[250])" in older version of DOS compiler (C600). When i am trying to use the same in in C++ compiler it's not accepting the "huge *". I need a help that how can i use the same thing in C++.
    To be technical, "huge" is not a C++ keyword. The compiler is perfectly correct in giving you an error when it saw the word "huge". It is the same as declaring "GetExactMatrix(int(Paul *buf_x)[250])" or "GetExactMatrix(int(Joe *buf_x)[250])"

    Now for a practical explanation -- "Huge pointers" existed in 16-bit DOS environments, and to accommodate this, various 16-bit C and C++ compilers allowed you to use a special modifier called "huge". However, for a 32-bit OS, there is no such thing as "huge pointers", so there is no longer any need to use "huge".

    Just get rid of the "huge" modifier.

    Regards,

    Paul McKenzie

  4. #4
    Join Date
    Jun 1999
    Location
    San Diego, CA
    Posts
    600
    "Just get rid of" the huge specifier may not be the best solution. What if one day you need to port it back to a 16 bits system, a low end embedded system, for example? Do you put "huge" back on one by one?

    Just put something at the top of the source file to redefine "huge" to nothing, your problem will be solved.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured