场景:
1.编译器没有显式的指定。
2.需要根据32,64做不同的处理.
方法1:
#include "stdio.h"
int main(int argc,char * argv[])
{
void* number = 0;
printf("%d\n",sizeof(&number));
}
输出8就是64位的,4就是32位的。根据逻辑地址判断。
方法2:
可以用file命令判断(如果安装了msys的话,linux下应该自带)
file msys-expat-1.dll
msys-expat-1.dll: PE executable for MS Windows (DLL) (console) Intel 80386 32-bi
t
方法3:
If you have a hex editor program, just open your file with it and shortly after the standard header intro stuff (like
"This program canno
在编译器未指定且需针对32位或64位系统进行不同处理时,可以通过多种方法判断程序的位数。例如,使用`file`命令或者VS的`dumpbin`工具查看程序头信息。
订阅专栏 解锁全文
472

被折叠的 条评论
为什么被折叠?



