如何动态获取系统架构? [英] How can I dynamically get the system architecture?

查看:28
本文介绍了如何动态获取系统架构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所说

有没有办法在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.

在这种情况下,您可以使用 GetSystemInfoGetNativeSystemInfo 检索有关系统和处理器的一些基本信息.如果您需要有关处理器及其支持的特定功能的更多信息,可以使用 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屋!

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