Visual Studio中的远指针声明 [英] far pointer declaration in Visual Studio

查看:107
本文介绍了Visual Studio中的远指针声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以这种方式声明了一个远指针:

I have a far pointer declaration in this way:

char far *p;

但是Visual Studio 2008给了我

But visual studio 2008 give me

error C2146: missing ';' before identifier 'p'

感谢您的帮助.

推荐答案

far是16位Microsoft编译器(可能还有其他旧编译器)中的关键字.如今,在32/64位世界中,此关键字已过时且无用.

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.

通常Windows头文件将far定义为扩展为空.

Normally the Windows header files define far as expanding to nothing.

如果包含windows.h,则应编译代码.

If you include windows.h your code should compile.

如果您不能或不想包含windows.h,则可以在文件或项目的任何适当的头文件中添加#define far.

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.

或者最好手动从源文件中删除far.

Or best remove far manually from your source files.

这篇关于Visual Studio中的远指针声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆