您如何编写同时兼容 32 位和 64 位的代码? [英] How do you write code that is both 32 bit and 64 bit compatible?

查看:37
本文介绍了您如何编写同时兼容 32 位和 64 位的代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我想让我的代码在 32 位和 64 位平台上正确运行,我需要考虑什么?

What considerations do I need to make if I want my code to run correctly on both 32bit and 64bit platforms ?

我需要注意哪些领域,例如打印字符串/字符或使用结构?

What kind of areas do I need to take care in, e.g. printing strings/characters or using structures ?

推荐答案

选项:

使用虚拟机(例如Java)以某种语言对其进行编码

Code it in some language with a Virtual Machine (such as Java)

在 .NET 中对其进行编码,并且不针对任何特定架构..NET JIT 编译器 会在运行之前为您编译为正确的架构.

Code it in .NET and don't target any specific architecture. The .NET JIT compiler will compile it for you to the right architecture before running it.

这篇关于您如何编写同时兼容 32 位和 64 位的代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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