I am currently writing a program where I need to know how long it takes for it to do a loop so that I might optimise it. For that purpose I have found the example in difftime here on the site and tried to follow its example.
My code looks like this.
If I remove the loop it correctly says "This took0seconds"
If I put in any loop I get a compile error "error: expression must have (pointer-to-) function type" for the two lines with time() in them.
All examples I can find online about difftime shows this way of doing it so I am at a loss why it does not work.
I use the g++4.3 compiler.
Thanks in advance for any help!
Okay embarrassing, the problem was because I had an array called time, I had not realised that the two would conflict.
I apologise for the inconvenience!