我怎样才能动态地获得系统架构?架构、动态、系统

2023-09-09 21:18:55 作者:长发及腰记得蹲坑要撩

那么正如标题所说

有没有什么办法让系统架构中的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 检索有关系统和处理器的一些基本信息。如果您需要了解它支持的处理器和特定功能的更多信息,你可以使用的 IsProcessorFeature present 找到他们(虽然它可能是一个有点尴尬用于此目的 - 你要问关于每个独立功能,并为每个布尔答案)。

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).

 
精彩推荐
图片推荐