Difference between revisions of "Code Formatting Conventions"

Jump to navigation Jump to search
→‎Whitespaces: Added info about pointers and casts
m (typo)
(→‎Whitespaces: Added info about pointers and casts)
Line 95: Line 95:
'''Operator overloading'''
'''Operator overloading'''


Operator keyword is NOT seperated from the name, except for type conversion operators where it is required
Operator keyword is NOT seperated from the name, except for type conversion operators where it is required.
<pre>
<pre>
struct Foo {
struct Foo {
Line 106: Line 106:
     }
     }
};
};
</pre>
'''Pointers and casts'''
No whitespace after a cast; and in a pointer, we write a whitespace before the start but not after it.
<pre>
const char *ptr = (const char *)foobar;
</pre>
</pre>


1,079

edits

Navigation menu