July 16th, 2003, 12:50 PM
c++ scope operator
I am having difficulty understanding this piece of code.
the display function displays time in civilian or military format,
what does ClockView::civilian do?
July 16th, 2003, 01:15 PM
I'm guessing that civilian is a constant variable defined in the ClockView namespace. Please see using std namespace; what does it mean? for more about namespaces.
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
July 16th, 2003, 01:19 PM
My guess is that ClockView contains an enumeration specifying different values for civilian and military.
Then, in your display function, you can test the parameter to see if it == civilian (0) or military (1) by accessing the enumeration using the scope resolution operator as follows: ClockView::civilian or ClockView::military.
civilian = 0,
More on the scope resolution operator
"Me fail English? That's unpossible!"