naruto1327
07-18-2006, 11:52 PM
I would like to know some of your C++ Coding Preferences.
With:
- Indentation
-- Four Spaces
- Bracket placement
void shout()
{
cout << "HELLO!!!!!!!";
}
- Spaces between operators and declarations
-- Yes: n + m; Yes: int n = 1;
- Spaces between function name and starting parenthesis
-- None: shout();
- Spaces between loop name and starting parenthesis
-- One: if (n == 0)
- Where the * goes in declaring a pointer (next to the type name or the variable name)
-- Not sure for now, thats why I'm asking for your preferences but for now it's: int * n;
- Where the & goes in declaring a reference (next to the type name or the variable name)
-- Same as pointers: int & m = n;
- Whether you omit the <int> in the following specialization:
(
template <> void swap<int>(int &, int &)
)
-- Yes
Responses would be very helpful. :)
With:
- Indentation
-- Four Spaces
- Bracket placement
void shout()
{
cout << "HELLO!!!!!!!";
}
- Spaces between operators and declarations
-- Yes: n + m; Yes: int n = 1;
- Spaces between function name and starting parenthesis
-- None: shout();
- Spaces between loop name and starting parenthesis
-- One: if (n == 0)
- Where the * goes in declaring a pointer (next to the type name or the variable name)
-- Not sure for now, thats why I'm asking for your preferences but for now it's: int * n;
- Where the & goes in declaring a reference (next to the type name or the variable name)
-- Same as pointers: int & m = n;
- Whether you omit the <int> in the following specialization:
(
template <> void swap<int>(int &, int &)
)
-- Yes
Responses would be very helpful. :)