Comments on Linux C Programming Tutorial Part 23 - Structures

So far in this ongoing C programming tutorial series, we have discussed several aspects, ranging from variables to functions to even pointers. However, that's still like scratching the surface, as there are many other important concepts in the C programming language. Today, in this tutorial, we will discuss one such concept - the concept of structures.

2 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Garyy Stewart

Using two ints as a description for a structure doesn'r work very well as it might confuse some people about the

difference between a structure and an array.. An int and a float or string would be a much better example. The

whole point of structures is to group different kinds of variables into one data type, the structure.

By: iu1j4

there is anothere way to declare a struct. We can use typedef to make a new type of data. For example:

typedef struct {

int id;

char *name;

} record_t;

 

record_t *records

 

records = (record_t *)malloc(100*sizeof(record_t));