黑马程序员匠心之作|C++教程从0到1入门编程--练习--结构体指针

代码功能:通过结构体指针访问结构体的成员,在这里我定义了结构体变量,和结构体数组来理解。 #include #include using namespace std; //定义结构体 struct Student { string name; int age; int score; }; int main() { //1、创建结构体变量 Student s1 = { “张美丽”,18,100 };
相关文章
相关标签/搜索