// test.cpp : 检查本机的CPU数量信息。
//
#include "stdafx.h"
#include< windows.h>
#include<stdlib.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
int cpus=0;
char aa[100];
SYSTEM_INFO sysinfo;//事例化一个system_info
GetSystemInfo(&sysinfo);//调用GetSystemInfo()
cpus=(int)sysinfo.dwNumberOfProcessors;//得到CPU的数量
MessageBox(NULL,_itoa(cpus,aa,10),"hello",0);//将结果输出
return 0;
}
//
#include "stdafx.h"
#include< windows.h>
#include<stdlib.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
int cpus=0;
char aa[100];
SYSTEM_INFO sysinfo;//事例化一个system_info
GetSystemInfo(&sysinfo);//调用GetSystemInfo()
cpus=(int)sysinfo.dwNumberOfProcessors;//得到CPU的数量
MessageBox(NULL,_itoa(cpus,aa,10),"hello",0);//将结果输出
return 0;
}