如何动态获取系统架构? [英] How can I dynamically get the system architecture?
问题描述
正如标题所说
有没有办法在c++中获得系统架构?
is there any way to get the system architecture within c++?
谢谢!
推荐答案
基于动态"和Visual C++",我猜你想在 Windows 下的运行时执行此操作.
Based on "dynamically" and "Visual C++", I'm going to guess you want to do this at run-time under Windows.
在这种情况下,您可以使用 GetSystemInfo
或 GetNativeSystemInfo
检索有关系统和处理器的一些基本信息.如果您需要有关处理器及其支持的特定功能的更多信息,可以使用 IsProcessorFeaturePresent
以找到它们(尽管为此目的可能有点尴尬——您必须单独询问每个功能,并为每个功能提供布尔答案).
In that case, you can use GetSystemInfo
or GetNativeSystemInfo
to retrieve some basic information about the system and processor. If you need more information about the processor and specific features it supports, you can use IsProcessorFeaturePresent
to find them (though it can be a little awkward for this purpose -- you have to ask about each feature individually, and gives a Boolean answer for each).
这篇关于如何动态获取系统架构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!