I am new to C++ and would like to know what style I should use to write my codes. For example, should I use:
for (int i=0; i < 10; ++i) {
cout << i << endl;
}
or
for (int i=0; i < 10; i++)
{
cout << i << endl;
}
That is, should I put the starting bracket on the next line, should I use ++i or i++, how many spaces should I indent, should I use tabs, etc?
Is there any standard C++ programmers follow?
Any help will be appreciated.
Thanks.