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

We need to decompile ex4 to mq4, We need to Decompile ex4 to mq4 I have ...

We need to Decompile ex4 to mq4 I have three expert advisors for mt4, which I need to decompile to its original mq4 code. Skills required are C Programming, C++ Programming,

Computes the ackermann-peter a m-n function, (a) Write a procedure that com...

(a) Write a procedure that computes the Ackermann-Peter a(m,n) function. (b) Write a helper procedure that only allows the calculation of the Ackermann-Peter function for 0≤m

Constructor: Copy, b) Why copy constructor accepts reference to an object a...

b) Why copy constructor accepts reference to an object and not the object itself? What happens if we do otherwise?

Minimum shelf, At a shop of marbles, packs of marbles are prepared. Packets...

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers

C program for sorting of character , #include stdio.h> #include conio.h>...

#include stdio.h> #include conio.h> #include string.h>   void main() {           char a[50],b[25][25],l[25],temp1;           int i=0,j=0,k=0,l1[25],c=0,c1=0,t=

I need whatsapp software in my website, I need whatsapp software in my webs...

I need whatsapp software in my website Project Description: i need whatsapp software in my website same this whatsapp if anyone can make to me this in my website Skills

Arrays, Write two different arrays. Store the names in it and then compare ...

Write two different arrays. Store the names in it and then compare if both the names entered by the user are the same.

Heating and thermodynamic, i want software to calculate heating or use ther...

i want software to calculate heating or use thermodynamic equation , pleas help me

Program to calculate gross pay and tax payable, Study the following table u...

Study the following table used to compute the tax payable by employees in certain organization   Gross Pay                                  Fewer than Three             Three

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