April 1st, 2003, 05:30 PM
|
#11 (permalink)
|
| Senior Member
Join Date: May 2002 Location: Rocky Mountain High
Posts: 613
|
In your initial post, you declared State as a variable of type bool. This means that you can only give it two values: true and false.
Since in your comments, you mentioned that the open state is represented by true, and closed by false, use that in the definition: Code:
void BarrierType::BarrierOpen(void)
{
State = true;
}
void BarrierType::BarrierClosed(void)
{
State = false;
} Two notes on these functions:
1) These two functions are members of the class, so they need to be named as associated with the class by the scope resolution operator ( :: ) like above: BarrierType::BarrierOpen()
2) Do not put semicolons after the function names. A semicolon is the period after a C++ sentence, and if it's there the compiler will not associate that line with the below class definition.
Also, FYI in case you care: The fancy names for these functions are "Accessors" because they give main and others access to private data 
__________________
Talking in numbers doesn't make you smarter.
|
| |