Click to See Complete Forum and Search --> : Using huge pointer in C++


sam_sun_401
June 19th, 2002, 02:08 AM
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++.

Simon Wilkins
June 19th, 2002, 02:46 AM
I don't think you need to worry about specifiying a 'huge' pointer any more. Try removing it from the function header.

Paul McKenzie
June 19th, 2002, 04:54 AM
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

Anthony Mai
June 19th, 2002, 09:20 AM
"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.