ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Removed Areas > C / C++

Exploring C++

(1/3) > >>

I have Dev-C++'m trying to create fun programs with it.So i pick up something

interesting and I'm attempting to create console based program to get the system details

such as:
1.CPU type (Name,specification,Speed)
2.Installed Operating system
3.Current Time
4.Motherboard Type
5.Cache Memory
6.Memory Slot detection (Type of Memory)

The problem i'm facing is how can i retreive this type of data from system using console based program?If i'm writing the program in C++,what header files i have to include? Which functions of the header are necessary to call in such case?Is it possible to create the same programs in Borland C++ Builder 6?Where to look into the help files?Which methods usually?It is really hard to find something in the help file,i hope i can get some pointer to work with.

A few to get you started...


Things like detecting memory, cpu usage etc, are very platform specific. Basically, you have to ask the operating system for that info. On windows those will be win32 API calls, on GNU/Linux you can query the files in /proc

Here's an example + source code for windows:

If you want to make it cross-platform, you can detect the operating system with #ifdef statements and have a block of code for each OS you want to implement.

Yes, this can also be done in C++ builder. C++ builder is fully compatible with C++, but then it will be windows-only of course.

There are functions to get the current time in the C time library which comes with most if not all C++ compilers by default. Info here: Example here:

When coding C++, the standard template library is your friend. Reference:

Also, lots of things have been done before, and exist in libraries. And since pure C++ is cross-platform, I recommend you stick to cross-platform libraries for your programs if you're not using C++ Builder, in case your users ever want to use your application on a different operating system. (wxWidgets is a good cross-platform library (mainly for GUI, but has increasingly lots of other handy stuff like filesystem access, time, locales, etc,...)

Thanks all i'm just get started with it.As devcp uses mingw i have to search for files specific to these.I'll let u know abt that.

also i was looking for creating some winamp style visualization with c++ graphics i wonder how to create cool visualization like these.?

Since you're on windows, consider looking at VC++ 2008 Express instead of devcpp/mingw - it's a more fully-featured product, and it's free.

As for cool C++ graphics and winamp visualisations, get comfortable with C++ and you IDE first...


[0] Message Index

[#] Next page

Go to full version