zoukankan      html  css  js  c++  java
  • 结构体数组指针

    #include <stdio.h> #define W 50

    struct Students{

        char name[20];     int sno;     float yu;     float shu;     float ying;    

    }stus[W]={{"zhao",0,20,99,97},   

    {"zhao1",1,97,96,95},  

       {"qian",2,95,96,92},  

       {"hong",3,100,93,97},  

       {"zhou",4,90,90,90}};

    int count =4;

    void del1(struct Students *stu1) {    

        int a;  

       printf("请输入要删除的学号");   

      scanf("%d",&a);   

      getchar();    

        for (int i=a; i<count; i++) {        

            if (stus[i].sno != stus[i +1].sno) {      

           *(stu1+i)=*(stu1+i+1);     

               }       

          }     count--;   

      printf("删除成功 ");

    }

    int main(int argc, const char * argv[]) {  

       del1(stus);     return 0;

    }

  • 相关阅读:
    08-认识margin
    07-border(边框)
    06-padding(内边距)
    05-盒模型
    04-层叠性权重相同处理
    03-继承性和层叠性
    MySQL安装与基本管理
    数据库概述
    并发编程练习
    selectors模块
  • 原文地址:https://www.cnblogs.com/wangjinshan/p/7145482.html
Copyright © 2011-2022 走看看