|
http://www.jindent.com |
Previous: QuestionsMarks
|
Next: Scopes
|
| Space before colons of base specifiers |

|
class·AnotherTest·:Test |
|
class·AnotherTest:Test |
| Space after colons of base specifiers |

|
class·AnotherTest:·Test |
|
class·AnotherTest:Test |
| Space before colons of constructor initializers |

|
AnotherTest(int·a,·int·b)·:Test(a,·b) |
|
AnotherTest(int·a,·int·b):Test(a,·b) |
| Space after colons of constructor initializers |

|
AnotherTest(int·a,·int·b):·Test(a,·b) |
|
AnotherTest(int·a,·int·b):Test(a,·b) |
| Space before colons of ternary conditions |

|
int·x·=·(a·==·0)·?·b·:·c; |
|
int·x·=·(a·==·0)·?·b:·c; |
| Space after colons of ternary conditions |

|
int·x·=·(a·==·0)·?·b·:·c; |
|
int·x·=·(a·==·0)·?·b·:c; |
|
See also: | Space before question marks of ternary conditions , Space after question marks of ternary conditions |
| Space before colons of labels |

|
myLabel·:···while·(a·<·10)·{ ···············... ···············break·myLabel; ···············... ············} |
|
myLabel:····while·(a·<·10)·{ ···············... ···············break·myLabel; ···············... ············} |
| Space after colons of labels |

|
myLabel:·while·(a·<·10)·{ ···... ···break·myLabel; ···... } |
|
myLabel:while·(a·<·10)·{ ···... ···break·myLabel; ···... } |
| Space before colons in switch-case blocks |

case colons or not.|
switch(a)·{ ····case·1·: ········cout·<<·"one"; ········break; ····case·2·: ········cout·<<·"two"; ········break; ····case·3·: ········cout·<<·"three"; ········break; ····default·: } |
|
switch(a)·{ ····case·1: ········cout·<<·"one"; ········break; ····case·2: ········cout·<<·"two"; ········break; ····case·3: ········cout·<<·"three"; ········break; ····default: } |
| Space before colons of bit fields |

|
bool·field1·:0; bool·field2·:1; |
|
bool·field1:0; bool·field2:1; |
| Space after colons of bit fields |

|
bool·field1:·0; bool·field2:·1; |
|
bool·field1:0; bool·field2:1; |