Explain structures, C/C++ Programming

Assignment Help:

Structures

A structure is a derived data type. It is a combination of logically related data items. Unlike arrays, which are a collection of such as data types, structures can be made of members of unlike data type. The data items in the structures usually belong to the same entity, like information of an employee, players etc.

The general format of structure declaration is:

struct tag

                 {

                                type member1;

                                type member2;

                                type member3;

                                :

                                :

}variables;

We can omit the variable declaration in the structure declaration and explain it separately as follows :

struct tag variable;

In C++ we can omit struct and simply write :

tag variable;

e.g.

Structure definition.

                struct account

                 {

                                int accnum;

                                char acctype;

                                char name[25];

                                float balance;

                 };

 

Structure declaration.

struct account oldcust; [or]

account newcust;

We can refer to the member variables of the structures by using a dot operator (.).

 


Related Discussions:- Explain structures

Define register variables - low level programming, Define Register Variable...

Define Register Variables - Low Level Programming? The Register variables are a special case of an automatic variable. The Automatic variables are allocated storage in the memo

Array, Assigning value to individual elements in array

Assigning value to individual elements in array

How can we simulate the concept of multiple inheritance, Problem: (a) U...

Problem: (a) Using a class hierarchy of your own choosing, with at least TWO subclass levels, show (i) the use of abstract and concrete forms of Java class and method in you

Decode, Smugglers are becoming very smart day by day. Now they have develop...

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

Explain topologies for the network information system, Problem: a) Give...

Problem: a) Give and Illustrate with the help of diagrams, four topologies for the Network Information System (NIS). b) Give methods for creating user accounts and groups.

FILES, My file pointer is going to the location which i specified and writi...

My file pointer is going to the location which i specified and writing the value but it is in next line so,please help me iam developing in visual studio6

Write a program to create a binary file, Write a program to create a binary...

Write a program to create a binary file and store the following data "hello", 0x0030,'1', 1.234  Using visual studio examine the binary file and note how the day is stored   Answe

What is class definition, Class Definition The following is the general...

Class Definition The following is the general format of defining a class template: class tag_name                  {                    public  :               // Must

Area under curve, a program to find the area under curve y=f(x) between x=a...

a program to find the area under curve y=f(x) between x=a and x=b,integrate y=f(x) between the limits of a and b.   #include float start_point, /* G

Explain operator overloading fundamentals, Operator Overloading Fundamental...

Operator Overloading Fundamentals The C language uses the concept of Operator Overloading discreetly. The asterisk (*) is used as multiplication operator as well as indirect

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd