how good is your C++?

Pages: 12
Mar 20, 2012 at 12:16pm
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 Mar 20, 2012 at 12:19pm
Mar 20, 2012 at 12:36pm
I recall reading that Stroustrup rates himself around 6 or 7, out of 10.
Mar 20, 2012 at 12:57pm
I believe that one shouldn't be rated by himself. Let others decide how good are you.
Mar 20, 2012 at 1:09pm
If somebody rates themselves a ten, they must be the compiler.
Mar 20, 2012 at 1:12pm
Ha. I've yet to see a C++ compiler without any bugs.
Mar 20, 2012 at 1:21pm
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 Mar 20, 2012 at 1:24pm
Mar 20, 2012 at 2:02pm
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 =^_^=
Mar 20, 2012 at 2:06pm
@iHutch105: JLBorges would deduct points for that!
http://www.cplusplus.com/forum/general/63907/
Mar 20, 2012 at 2:18pm
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.
Mar 20, 2012 at 5:03pm
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 Mar 20, 2012 at 5:04pm
Mar 20, 2012 at 5:15pm
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?
Mar 20, 2012 at 5:16pm
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.
Mar 20, 2012 at 5:20pm
% is the modulo operator and has higher precedence than addition, which should answer your question.
http://en.wikipedia.org/wiki/Modulo_operation
Mar 20, 2012 at 5:40pm
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.
Mar 20, 2012 at 10:43pm
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.
Mar 20, 2012 at 10:53pm
I see, I thought it included 10, guess not
Mar 20, 2012 at 10:57pm
Don't think, look up what modulo is instead.
Mar 20, 2012 at 11:01pm
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.
Mar 21, 2012 at 9:01am
Don't assume - it makes an ass out of u and me. ;-)
Mar 21, 2012 at 3:34pm
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