This is a question is w.r.t to my assignment in my Operating Systems Class. I am not posting the code, but asking a general doubt. Since the project is to build an OS, there are no debugging tools. So any help is appreciated.
I have a header file which looks like this:
class test {
private:
unsigned long base_address;
unsigned long size;
public:
test();
void method1();
void method2();
};
The corresponding C file looks like this:
#include "test.H"
unsigned long table;
test::test(){
base_address = some_value; //initialise the variables
size = some_other_value;
table = another_value;
//some code
}
void test::method1(){
//some code
}
void test::method2(){
//some code
}
This code works fine, and I get the desired output. My problem is that I wanted to make the variable "table" (currently declared and used throughout all the functions in the C file), as a class variable. When I remove it from the C file and put it under the private variables in the header file, it compiles fine but then my output blows up. Any pointers to what I should look into.? (Sorry I know its hard without knowing the context, but thanks for the help.)