Name: Anonymous 2010-05-24 12:37
Hi, /prog/.
What is the most beloved syntax style here? KR? BSD? GNU, perhaps?
What is the most beloved syntax style here? KR? BSD? GNU, perhaps?
public: et al. to the same level as other code in a class definition is awful, because they're fundamentally different from the rest of the content. Same applies for labels and case statements. I prefer writing these lines at the indentation level of the enclosing block, but anything except what you did would be an improvement to readability.int *a, *b is consistent, but I don't like declaring a bunch of variables on one line, either, so really which way you write it doesn't matter a whole ton. Consistency and clarity do, however, so the goal is to come up with something that communicates your intent, and stick with it, whatever it might be.progtroll dynamically simply to show how you format pointer declarations, but if not, there really wasn't a reason to allocate and then deallocate one single instance of something unconditionally within the same function.srand exactly once, at the start of your program. (If you meant to have a different RNG for each instance of that class, you did it wrong.) I would also avoid the [4] in the array declaration, using [] instead. (Or does C++ disallow that for some insane reason? I'm not really a C++ programmer, I just use it when I have to)endl part of std?