how good is your C++? Plus how could you rate yourself.
I'm currently at the state where I've realised that C++ is impossible to perfect and that proficiency/how good you are is only limited/measured by the type of problems you try to conqure. So far I would say that I'm an expert at understanding C++ syntax and I fully know that its different from being able to harness the language proficiently (but again thats limited by what you try to conqure).
I'm now hearding to the botomless pitt of C++ perfection, and I'm at the very beginning. What stage would you call this?
Wow. Good question. Seems impossible to answer, though.
C++ is constantly growing with additional libraries. If someone is particularly proficient with OpenGL libraries, would that be considered a representation of their C++ skills? Libraries almost abstract from the language itself, so it's a difficult one to call.
I'll answer this the only way I can see fit. On a scale of one to ten:
Fumbles, srand is a funtion that "seeds" a random generator. Basically, it allows the generator to be psuedo-random. I don't know how. that's compiler magic. Anyway, rand() selects a random number. rand()%10 selects a random number from 0 to 10. rand()%10+1 selects a number between 1 and 10.
time(NULL) uses the time (the most random option) for your psuedo random seed.
yeah hutch, but thats assuming it was a direct way of generating it, by doing %10+1, you're saying "generate a random number from 0 to 10, including 0 and 10, and then add one to it, so that the range becomes 1 to 11" unless %10 doesn't include 10, in which case it would be 1 to 10, which is what I meant by 9+1.
you're saying "generate a random number from 0 to 10, including 0 and 10, and then add one to it
Not quite. I'm essentially saying "generate ten numbers from zero then add one to it". The ten numbers excluding the addition would be 0,1,2,3,4,5,6,7,8,9.
No thanks, I'd much rather go under the assumption that %10 includes 10, than try and understand what modulo is and end up more confused, at least the assumption has had a chance of being correct.
I always assume, and I'm not going to stop just because two people told me to >.>, in fact I'm not even going to bother with pure rand() anymore, I'll just make a function to add 1 to whatever range I give it, so that I can keep on assuming it includes the x of %x, much easier, and perfectly suitable for stubborn me.