Original Post
I'm a C programmer and right now I'm trying to learn a litle C++ also (since it's the standard game programming language). In my C++ book (C++ Primer Plus) it says that it's C++ practise to declare variables just before one use them. For example:
cout << "How big are your room in m^2?\n";
int room_area;
cin >> rom_area; And for a C programmer this looks very weird and ugly. And I just wonder which style do you use; the C-style (declare variables in the beginning of a function) or the C++ style (declare variables right before you use them)? Please motivate why. I use the C way since it feels better to have all variables in one place. And you can leave one comment for every variable at the beginning so you can watch what all variables do whitout goin down in the code.