OK, a single colon follows an access specifier, such as public:
or private: or protected:, right? Are there any other situations in which a single colon : is used?
OK, a single colon follows an access specifier, such as public:
or private: or protected:, right? Are there any other situations in which a single colon : is used?
intializer lists in constructors.
off the top of my head
GOTO:something
Inheritance access specifiers.
Code:class a : public b { public: a( ) : x(0) { label: ++x; if(x < 4) goto label; (x > 3) ? x = 2 : x = 1; } private: int x; };
Last edited by Zach L.; 07-17-2003 at 02:26 PM.
The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.
Accessing a static member of a class: ios_base::hex.
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Single colon. Thats two.Originally posted by XSquared
Accessing a static member of a class: ios_base::hex.
The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.
I need to pay more attention .
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Conditionals:
Condition ? TruePart : FalsePart
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
Bah! No I gotta change my example.
The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.
Code:cout<<"Enter a number:";
"Think not but that I know these things; or think
I know them not: not therefore am I short
Of knowing what I ought."
-John Milton, Paradise Regained (1671)
"Work hard and it might happen."
-XSquared
Most people tend to have only a single colon...
Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah
You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie
And the most obvious:
So don't make me get on your case about it!Code:switch( foo ) { case 1: cout <<"Hey, you forgot about me!" << endl; break; default: cout << "Yeah!" << endl; }
Quzah.
Hope is the first step on the road to disappointment.