• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 920
  • Last Modified:

Simple example using SYSTEM_INFO in C++

Can someone share me with some simple examples using SYSTEM_INFO in C++.  I just need a simple way in C++ to returns me the level of the CPU.

Thanks,

Lik
0
lik
Asked:
lik
  • 5
  • 3
1 Solution
 
jkrCommented:
What do you mean by the 'level of the CPU'? If you mean 'wProcessorLevel', you'd use

SYSTEM_INFO si;

GetSystemInfo ( &si);

switch ( si.wProcessorLevel) {
 
case 3: // x386
  break;
case 4: // x486
  break;
case 5: // Pentium
  break;
}

0
 
likAuthor Commented:
Thanks, jkr.

I found the SYSTEM_INFO from the MSDN, and know the code you provided will do the job.  The problem I have is I don't know what to header information include to use SYSTEM_INFO.  I searched the books and the internet, but just could not find any more information regarding this.  Can you help me more?

Thanks,
0
 
likAuthor Commented:
Thanks, jkr.

I found the SYSTEM_INFO from the MSDN, and know the code you provided will do the job.  The problem I have is I don't know what to header information include to use SYSTEM_INFO.  I searched the books and the internet, but just could not find any more information regarding this.  Can you help me more?

Thanks,
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
likAuthor Commented:
I just figured out I need to @include <windows.h>

Thanks for all you pros for the help :)
0
 
jkrCommented:
Thanks, great :o)

So, could we move this to the PAQs - unless you have further questions?
0
 
likAuthor Commented:
Sure. This case is close :)

Thanks,
0
 
jkrCommented:
>>Sure. This case is close :)

Well, actually, on EE questions are closed by selecting one of the comments as the answer... :o)
0
 
likAuthor Commented:
Helped with SYSTEM_INFO
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now