C语言结构体02#include #include


#include<stdio.h>

#include<string>

struct Student
{
int num;
char name[20];
char sex;
int age;
float score;
char address[30];
};

 

//结构体传带指针的参数

void PrintStruct(struct Student *pStudent)
{
printf("age = %d\n", pStudent->age);
printf("name = %s\n", pStudent->name);

}

 

//定义结构体指针----------
struct Student stu02;
stu02.age = 11;
strcpy_s(stu02.name, "JACK");
PrintStruct(&stu02);


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM