C Programming language

adplus-dvertising
What is an Array ?
Previous Home Next
adplus-dvertising

USES OF STRUCTURE

 Where are structures useful? The immediate application that comes to the mind is Database Management. That is, to maintain data about employees in an organization, books in a library, items in a store, financial accounting transactions in a company etc. But mind you, use of structures stretches much beyond database management. They can be used for a variety of purposes like:

  1. Changing the size of the cursor
  2. Clearing the contents of the screen
  3. Placing the cursor at an appropriate position on screen
  4. Drawing any graphics shape on the screen
  5. Receiving a key from the keyboard
  6. Checking the memory size of the computer
  7. Finding out the list of equipment attached to the computer
  8. Formatting a floppy
  9. Hiding a file from the directory
  10. Displaying the directory of a disk
  11. Sending the output to printer
  12. Interacting with the mouse

 SUMMARY

 

  1. Structure is usually used when we wish to store dissimilar data together.
  2. Structure elements can be accessed through a structure variable using a dot (.) operator.
  3. Structure elements can be accessed through a pointer to a structure using the arrow (->) operator. 
  4. All elements of one structure variable can be assigned to another structure variable using the assignment (=) operator.
  5. It is possible to pass a structure variable to a function either by value or by address.
  6. It is possible to create an array of structures.

     
Previous Home Next