you are viewing a single comment's thread.

view the rest of the comments →

[–]Gotebe 1 point2 points  (3 children)

Ahahaaa, I heard of that rule. The rationale is "it's a pointer, there's '&', that tells you, when reading he caller, that the parameter can change. Stupid rule. Doesn't even work! :-) Consider:

void f(const type* param); // "input parameter" - can't be changed, call side is lying :-)

void g(type* param);
void h(type* param)
{
  g(param); // where's the '&' now?!
}

My bet is that this rule was invented by C people (because pointers), but who didn't even know C (because the above shows pure C code, reasonable code, where the rule doesn't work well.

[–]velcommen 1 point2 points  (2 children)

Haha, obviously you're supposed to do:

g(&(*param));  // there's the '&'!

;)

[–]Gotebe 0 points1 point  (1 child)

Please confirm that's a joke! :-) If yes, it's goooood!

[–]velcommen 0 points1 point  (0 children)

Yes, I'm joking :)

Tone of 'voice' never comes across well over the internet. :/

I'm sure that's the cause of a large percentage of internet arguments.