91学习

陪伴你每一天!

共用体变量的初始化

   共用体变量中起作用的永远是最后一个放入的成员,不能对共用体变量赋值,也不能引用变量名得到一个值#include <stdio.h>#include <string.h>struct sea{ char name[64];};union season{ struct sea p;};int main(){ union season s; strcpy(s.p.name,"夏季"); printf("现在是:%s\n&q

用共用体设计一个一次只能装一种水果的罐头瓶

#include <stdio.h>#include <string.h>struct peaches{ char name[64];};struct coconut{ char name[64];};struct hawthorn{ char name[64];};union tin{ struct peaches p; struct coconut c; struct hawthorn h;};int main(){ union tin t; strcpy(t.p.

输出最火的3个游戏

#include <stdio.h>#include <stdlib.h>struct Game{ char cName[20]; int iNumber; struct Game* pNext;};int iCount;struct Game* Create(){ struct Game* pHead=NULL; struct Game* pEnd,*pNew; iCount=0; pEnd=pNew=(struct Game*)malloc(sizeof(struct

删除第二个节点

#include <stdio.h>#include <stdlib.h>struct Clerk { char cName[20]; int iNumber; struct Clerk* pNext;};int iCount;struct Clerk* creat(){            struct Clerk* pHead; struct Clerk* pEnd,*pNew; iCount=0;

插入节点

#include <stdio.h>#include <stdlib.h>struct Clerk { char cName[20]; int iNumber; struct Clerk* pNext;};int iCount;struct Clerk* creat(){            struct Clerk* pHead; struct Clerk* pEnd,*pNew; iCount=0;

创建职工链表

#include <stdio.h>#include <stdlib.h>struct Clerk{ char cName[20]; int iNumber; struct Clerk* pNext;};int iCount;struct Clerk* Create(){ struct Clerk* pHead=NULL; struct Clerk* pEnd,*pNew; iCount=0; pEnd=pNew=(struct Clerk*)malloc(sizeof(

结构体中含有结构体输出学生基本信息

#include <stdio.h>struct date{ int year; int month; int day;};struct student{ char name[30]; int num; char sex; struct date birthday;}student={"suYuQun",12052212,'w',{1986,12,6}};int main(){ printf("-----Information-----\

使用结构体变量的指针作为参数输出数据

#include <stdio.h>struct Student{ char cName[20]; float fScore[3];}student={"SuYuQun",98.5f,89.0,93.5f};void Display(struct Student* stu){ printf("-----Information----\n"); printf("Name:%s\n",stu->cName); printf

结构体变量作为函数参数输出学生成绩

#include <stdio.h>struct Student{ char cName[20]; float fScore[3];}student={"SuYuQun",98.5f,89.0,93.5f};void Display(struct Student stu){ printf("-----Information------\n"); printf("Name:%s\n",stu.cName); printf(&q

定义一个班级结构体,输出班级学生信息

#include <stdio.h>struct Student{ char cName[20]; int iNumber; char cSex; int iGrade;}student[5]={{"wangjiasheng",12062212,'M',3},{"YuLongjiao",12062213,'w',3},{"JiangXuehuan",12062214,'w',3