zoukankan      html  css  js  c++  java
  • 程序里面用的最多的数据结构之一集合数据结构

                                                                       这个是最常用的数据结构,也就是说的封装。                                                            

    digraph collectstruct{

    deviceName;

    toolName;

    gameName;

    muralName;

    };

                       

    //   集合结构 : 缺点对数据的访问不能使用 for循环,只能一个个通过名字取得到数据

    #include <windows.h>
    #include <stdio.h>
    
    
    // 下面可以想象我家的房间的样子
    // 我的家结构   内存是立体的
    struct Aggregation_DataStruct
    {
        char* deviceName;
    
        char* toolName;
    
        char* gameName;
    
        char* muralName;
    
    };
    
    static struct Aggregation_DataStruct DataStuct_Aggregation = 
    {
        .deviceName  = "手机",
        .toolName    = "风扇",
        .gameName    = "穿越火线",
        .muralName   = "奥黛丽赫本"
    };
    
    
    int main() {
    
    
        //while (1) 
        {
             //集合结构  离散结构 不能使用for循环  通过一个首地址取得的各个元素的内容
            for (int i = 0; i < 4; i++)
            {
                    printf("DataStuct_Aggregation  is %s\n", ((DataStuct_Aggregation.deviceName+i)));
    
            }
    
            //只能下面操作
            printf("deviceName is %s\n", DataStuct_Aggregation.deviceName);
            printf("toolName  is %s\n", DataStuct_Aggregation.toolName);
            printf("toolName  is %s\n", DataStuct_Aggregation.gameName);
            printf("muralName is %s\n", DataStuct_Aggregation.muralName);
            
        }
    
        while(1);
    }

    一勤天下无难事。
  • 相关阅读:
    从头来之【图解针对虚拟机iOS开发环境搭建】 (转)
    换工作?请记得8、18、48与72这四个密码(转)
    php
    linux上svn连接visual svn server时ssl鉴权失败,问题解决(转)
    javamail发送邮件的简单实例(转)
    稀疏矩阵
    Redis11种Web应用场景
    说说ShellExecuteEx
    怎样从host之外连接到docker container
    hadoop日志分析
  • 原文地址:https://www.cnblogs.com/nowroot/p/12444411.html
Copyright © 2011-2022 走看看