I have a far pointer declaration in this way:
char far *p;
But visual studio 2008 give me
error C2146: missing ';' before identifier 'p'
Any help is appreciated.
I have a far pointer declaration in this way:
char far *p;
But visual studio 2008 give me
error C2146: missing ';' before identifier 'p'
Any help is appreciated.
far
was a keyword in the 16 bit Microsoft compiler (and possibly other old compilers). Nowadays in the 32/64 bit world this keyword has become obsolete and useless.Normally the Windows header files define
far
as expanding to nothing.If you include
windows.h
your code should compile.If you cannot or don't want to include
windows.h
, you can just add#define far
in your file or whatever appropriate header file of your project.Or best remove
far
manually from your source files.This is not standard C syntax. This was an added feature for < 32-bit compilers.
They are not needed and thus not supported on the modern compilers.
The implementation of this pointers may vary from compiler to a compiler.
The standard Microsoft compiler should not support this feature and should give you an error as it does. There might be a specific compiler for a specific hardware which extends the language to give you this feature.