how good is your C++?

Pages: 12
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?
Last edited on
I recall reading that Stroustrup rates himself around 6 or 7, out of 10.
I believe that one shouldn't be rated by himself. Let others decide how good are you.
If somebody rates themselves a ten, they must be the compiler.
Ha. I've yet to see a C++ compiler without any bugs.
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:
1
2
srand(time(NULL));
int my_skill = rand()%10 + 1;
Last edited on
Let's just say this:

1
2
srand(time(NULL));
int my_skill = rand()%10 + 1;


I don't know what that does.

Classic Fumbles =^_^=
@iHutch105: JLBorges would deduct points for that!
http://www.cplusplus.com/forum/general/63907/
I would get a slap on the wrists, wouldn't I?

Let's hope I'd get away with it as I didn't indicate the degree/level of 'randomness' involved.
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.
Last edited on
wouldn't rand()%10+1 either give a range of numbers from 1 to 11, or 0 to 11? or is the 10 not inclusive, i.e 9+1?
The number after the % is the range, the number after the + is the start point.

So you'll get a range of 10 numbers starting from 1: 1,2,3,4,5,6,7,8,9,10.
% is the modulo operator and has higher precedence than addition, which should answer your question.
http://en.wikipedia.org/wiki/Modulo_operation
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.
I see, I thought it included 10, guess not
Don't think, look up what modulo is instead.
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.
Don't assume - it makes an ass out of u and me. ;-)
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.
Pages: 12