Do not try to do that, natively. Instead, consider using the platform specific APIs, such as the Linux APIs for C or the Win32 API on Windows. The benefit is that you will be able to get the information, such as the information about hardware (I am not sure, whether you will be able to dig that much information or not). Start from somewhere like this, [How to get current CPU and RAM usage in C++? - Stack Overflow](https://stackoverflow.com/questions/479722/how-to-get-current-cpu-and-ram-usage-in-c) [sysinfo(2) - Linux manual page](http://man7.org/linux/man-pages/man2/sysinfo.2.html) You would then need to go on other platform APIs such as the Win32, and find out what is offered there. Such as, [GetSystemInfo function (Windows)](https://msdn.microsoft.com/en-us/library/ms724381(VS.85).aspx) will provide the system info for CPU. One thing is for sure: What works on Linux with C, is not going to work on Windows and vice versa. Also, none of this guarantees to provide CPU make, or RAM manufacturer name. In most cases, you will have to pull down a complete stream of data, and then parse it to extract the interested portion; such as in this post, [How to check processor and cpu details on Linux | Linux.com | The source for Linux information](https://www.linux.com/blog/how-check-processor-and-cpu-details-linux)
$ cat /proc/cpuinfo | grep vendor | uniq
vendor_id : GenuineIntel
$ cat /proc/cpuinfo | grep 'model name' | uniq
model name : Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz
$ lscpu
Architecture: x86_64
Which shows, that you will have to extract and then parse the data to show the interested part; otherwise, that doesn't quite work that way. Good luck Googling. :-)
The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~