OOP programming with data encapsulation in C
问题 I tried to do data encapsulation in C based on this post here https://alastairs-place.net/blog/2013/06/03/encapsulation-in-c/. In a header file I have: #ifndef FUNCTIONS_H #define FUNCTIONS_H // Pre-declaration of struct. Contains data that is hidden typedef struct person *Person; void getName(Person obj); void getBirthYear(Person obj); void getAge(Person obj); void printFields(const Person obj); #endif In ´functions.c´ I have defined the structure like that #include "Functions.h" enum { SIZE