Open main menu

CDOT Wiki β

Changes

Team G - OOP344 - 20132

996 bytes added, 14:37, 18 June 2013
Blocks
* Do not use tab character
=== Blocks ===
* '''If statement (short one-line statement):'''
<syntaxhighlight lang="cpp">
if(condition)doSomething(); // space between if and ( )</syntaxhighlight>* '''If statement (multi-line or long one line statement):'''<syntaxhighlight lang="cpp">if (condition) { // space between if ( ) and { // do something // use this for short one-line statements if you'd like}</syntaxhighlight>* '''If else statement:'''<syntaxhighlight lang="cpp">if (condition) { // do something} else if (condition) { // notice spaces // do something} else { // if else statements always use blocks even with short one line statements whatever// do something}</syntaxhighlight> * '''While statement (short one line statements):'''<syntaxhighlight lang="cpp">while (condition) doSomething(); //notice spaces</syntaxhighlight>'''OR:'''<syntaxhighlight lang="cpp">while (condition) { // do something}</syntaxhighlight> *'''Function declaration:'''<syntaxhighlight lang="cpp">void doSomething(int arg1, char arg2) { //notice spaces // do something}</syntaxhighlight> 
=== Variable Naming ===
<syntaxhighlight lang="cpp">