How to get number of cores in Win32?
You can call the GetSystemInfo
WinAPI function; it returns a SYSTEM_INFO
struct, which has the number of processors (which is the number of cores on a system with multiple core CPUs).
Even though the question deals with .NET and yours with C, the basic responses should help: