I read about the clock( ) function not long ago. I wrote the application out as in the example and it compiled with no errors or warnings. When it had compiled, it was using about 25% CPU. How could an application so simple be using so much CPU resources? Any idea why this is?
P.S: My system specifications can be found on my profile.
25%? Even without knowing the program itself, the fact that you have a 4-core CPU, the fact that you're using clock() in some way, and the fact that it appears you're completely utilizing exactly one core of your CPU makes me wonder...
Are you using clock() to create a delay in your program? If so, then this is one of the few cases in which I would suggest you use a platform specific solution. When you use clock() and a loop of sorts, you waste CPU cycles by checking every clock tick whether the waiting period is over yet. When you use a function like Sleep(milliseconds), one doesn't need to worry about wasting that many resources on something like creating a delay.
For Windows, I think you can use the Sleep() function (in <windows.h>), which takes the number of milliseconds to wait as a parameter. For most *nix variants, you can use usleep(), which does pretty much the same thing and takes pretty much the same arguments, except a different header is required (and a good thing too!).