I have 3 files: stack.h, calc,c and stack.c
Code:void make_empty(void); int is_empty(void); int pop(void);Code:#include "stack.h" main() { make_empty(); ... }I get that stack.h is the interface, calc.c is the client and that stack.c is the implementation of the module. My question is: What exactly is the module? The definition is "a collection of services", so I thought that would be stack.c, but it isn't?Code:#include "stack.h" int contents[100]; int top = 0; //function definitions
Also if you can access data members of a structure using the . and -> operator, why can't you use it with objects and member functions?
Since -> means (*abc).a, why can't you use it when calling member functions outside the class?Code:struct blah{ int a; int b; }; blah *abc; abc->a = 0;
Code:class Fraction { int denom; int num; public: void reduce(); }; Fraction *f1, *f2; f1->reduce();



LinkBack URL
About LinkBacks


