栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

C程序中如何区分windowsx86,x64

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

C程序中如何区分windowsx86,x64

1.理清一个概念:
windows x86指32位cpu
windows x64指64位cpu

2.如下代码:

#include 
//要引用C语言函数

extern "C" 
{
	#include 
}
//预处理指令来导入库
#pragma comment(lib,"avcodec.lib") 
using namespace std;

int main(int argc,char *argv[])
{
	//显示ffmpeg编译配置信息
	cout << "test FFmpeg.club" << endl;
#ifdef _WIN64    //64位
	cout << "windows x64" << endl;
#endif
#ifdef WIN32    //32位
	cout << "windows x86" << endl;
#endif
#ifdef _WIN32  //32位和64位
#else
	cout << "linux system operation" << endl;
#endif
	cout << avcodec_configuration() << endl;
	getchar();
	return 0;
}

分析:WIN32宏指的是,32
而_WIN32指的是32位和64位。所以这个宏主要用于区分windows和linux连个操作系统。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/665011.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号