Encapsulation and information hiding with pure C language
In what way is it possible to use encapsulation and information hiding principles with C language? (without considering Object Oriented paradigm and C++)
|
A well-known method for opaque data-types is the following:
Code:
/* somestuff.h */ Code:
/* somestuff.c */ |
Why did you declare functions as "extern" in header file?
|
It isn't necessary in this case, but it's often used to indicate that the function is going to be defined in another file (as opposed to later in the same file.) On the other hand, you would need to use extern for a global variable made available by the header to make it a declaration rather than a definition.
Kevin Barry |
Everything else is clear?
|
Ok, now everything is clear, thank you very much!
|
All times are GMT -5. The time now is 07:03 PM. |