From reading "object-oriented design introduction" (C.THOMAS WU), it tells me that object-oriented is data-centered. Unfortunately, I have a truly use of Class to make a program every experience, I can contact it, it is not complex, or the process is very good to solve this problem.
Recently, I came back, I saw an article on the C-circulated parameters, and the object-oriented objects in the 9CBS document home.
Look. http://dev.9cbs.net/Article/29/29250.SHTM Unfortunately 9CBS's article seems to be "shades", two classes have been used after using Struct and some pointers. Also inherited and multi-state. My road is not high enough, just when I read the C algorithm, in the first-class ADT, I smelled the ooh's breath. ADT is an abbreviation of an abbreviated data type (ABSTRACT DATA TYPE). The white and the data structure is a family. After a good package of data, the data and algorithm are separated by the interface. Isn't this OO?
For a long time, people have no difference between classes and structures, except for structures that cannot be initialized.
I don't know how to achieve its object-oriented characteristics after doing good ADT, I think it is not far away, let me walk back.
The following is a plural structure:
----- Typedef struct {float re; float implex; // Complex ADTCOMPLEX Complexinit (FLOAT, FLOAT); Float Re (Complex); Complex ComplexMult (Complex, Complex); --- # include "complex.h" // interface implements Complex Complexinit (Float Re, Float IM) {complex t; t.re = re; t.im = im; returnit t;} float re (complex z) { Return z.re;} float im (complex z) {return z.im;} complex complexMult (complex a, complex b) {complex t; t.re = a.re * b.re - a.im * b. Im; t.im = a.re * b.im a.im * b.re; returnit t;}