One of the data structure of the program set up inside with a data structure

                                                                   This is the most commonly used data structures, which means that the package.                                                            

digraph collectstruct{

 

deviceName;

toolName;

gameName;

muralName;

 

};

 

                   

 

// set of structures: the shortcomings access to data can not be used for loop, only one made to the data by name

#include <windows.h>
#include <stdio.h>


// The following can imagine the way my family room
 // My house is three-dimensional memory structure 
struct Aggregation_DataStruct
{
    char* deviceName;

    char* toolName;

    char* gameName;

    char* muralName;

};

static struct Aggregation_DataStruct DataStuct_Aggregation = 
{
    .deviceName   = " mobile phone " ,
    .toolName     = " fan " ,
    .gameName     = " Cross Fire " ,
    .muralName    = " Audrey Hepburn "
};


int main () {


    // the while (. 1) 
    {
          // set of a discrete structures can not be used for circulating through the contents of the respective elements of a first address acquired 
        for ( int I = 0 ; I < . 4 ; I ++ )
        {
                printf("DataStuct_Aggregation  is %s\n", ((DataStuct_Aggregation.deviceName+i)));

        }

        // only the following operation 
        the 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);
}

 

 

Guess you like

Origin www.cnblogs.com/nowroot/p/12444411.html
Recommended