Structure in C Language . Structure helps to construct a complex data type in more meaningful way. It is somewhat similar to an Array. The only difference is that array is used to store collection of similar datatypes while structure can store collection of any type of data. Suppose you want to store record of Student which consists of student name, address, roll number and age. You can define a structure to hold this information. These fields are called structure elements or members. Each member can have different data type,like in this case, name is of char type and price is of int type etc. Book is the name of the structure and is called structure tag. Structure variable declaration is similar to the declaration of variables of any other data types. Structure variables can be declared in following two ways. Declaring Structure variables separately. However this approach is not much recommended. Structure member has no meaning independently. In order to assign a value to a structure member, the member name must be linked with the structure variable using dot . Each element of the array representing a structure variable. Example : struct employee emp. Each element of array emp is of type employee. C Programming/Structure and style. You can then go into detail over how each aspect of the program is achieved later on in. Unions and Structures. It is powerful concept that we may after need to use in our program Design. Hello can any explain structure.
C program compilation steps or phases or process in detail. C Program Compilation Steps. You compile c program and. We will use below hello.c program to expain.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2017
Categories |