Here is my CBulb.h:
Code:
class CBulb
{
private:
int state; // state of the bulb (0=off, 1=on)
public:
void print(void); // prints the value of state
void setstate(void); // sets state = the new value entered
};
the source code for CBulb.cpp:
Code:
#include "CBulb.h"
#include <iostream>
void CBulb::print(void)
{
std::cout<<"The value of state is "<<state<<std::endl ;
}
void CBulb::setstate(void)
{
std::cin>>"Please enter the new value of the bulb state in 0(on) or 1(off) ">>state ;
std::cout<<" "<<std::endl;
}
and this is my driver cpp:
Code:
#include "CBulb.h"
#include <iostream>
void CBulb::print(void)
{
std::cout<<"The value of state is "<<state<<std::endl ;
}
void CBulb::setstate(void)
{
std::cin>>"Please enter the new value of the bulb state in 0(on) or 1(off) ">>state ;
std::cout<<" "<<std::endl;
}
They are compiled using "Multithreaded DLLs" run-time library on "Pentium" processor in the code generation settings of the project.