C + + is inherited and extended by the language, and C + + is a lot of things from C language development,
Here's how it explores the relationships of structs in C + + classes and C languages:
A special data structure used in the C language is called a struct, for example:
struct STU_INFO
{
unsigned long number;
Char *name;
Char *sex;
} ;
Structs in C + + are expanded as follows:
struct STU_INFO
{
unsigned long number;
Char *name;
Char *sex;
Public:
void Set_name ();
void Get_number ();
} ;
The way you define a class in C + + is similar to the way you define a struct, as follows:
struct STU_INFO
{
unsigned long number;
Char *name;
Char *sex;
Public
void Set_name ();
void Get_number ();
} ;
From the above, the class in C + + is developed from the structure of C language.
The evolution process of C-language structure to C + + class