How to define a structure, C/C++ Programming

Assignment Help:

How to Define a Structure?

Structure declarations are rather more complicated than array declarations, ever since a structure must be defined in terms of its individual members. Generally the composition of a structure may be defined as

struct tag
{
member 1;
member 2;
member m;
} g;

In this declaration struct is a necessary keyword tag is a name that identifies structures of this kind (structures having this composition) and member 1, member 2, . . . , member m are individual member declarations.

The individual members are able to be ordinary variables, arrays, pointers or other structures. The member names within a particular structure should be distinct from one another, though a member name is able to be the same as the name of a variable that is defined outside of the structure. A storage class but can't be assigned to an individual member, and individual members can't be initialized inside a structure type declaration. Formerly the composition of the structure has been defined individual structure type variables can declare as follows.

storage-class struct tag variable 1, variable 2,..., variable n;

where
storage-class is an optional storage class specifier,
struct is a required keyword,
tag is the type name that is used in the structure declaration,
variable 1, variable 2,...., variable n are structure variables of type tag


Related Discussions:- How to define a structure

Structures, please answer the question of following Write a function that c...

please answer the question of following Write a function that calculates the number of elapsed days between two dates. For example the days between Feb 3, 1970 and June 21, 1980? B

Find the internal resistance of the battery, The voltage at the terminals o...

The voltage at the terminals of a battery is 52V when no load is linked and 48.8V when a load taking 80A is connected. Find the internal resistance of the battery. What wou

What is the difference between = symbol and = = symbol, What is the differe...

What is the difference between = symbol and == symbol? - The = symbol is generally used in mathematical operations. It's used to assign a value to a given variable whereas the

Write a program to sort an array of strings, Write a program to sort an arr...

Write a program to sort an array of strings. Use new and delete operators. Write a program to find the factorial of a number using recursion. If we do not accept the number

Padovan string , write a program that counts the number of occurences of th...

write a program that counts the number of occurences of the string in the n-th Padovan string P(n) program in java // aakash , suraj , prem sasi kumar kamaraj college progr

Structure, Write a function that calculates the number of elapsed days betw...

Write a function that calculates the number of elapsed days between two dates. For example the days between Feb 3, 1970 and June 21, 1980? Becareful for the Leap year

Write a simple telephone book program, Write a simple telephone book progra...

Write a simple telephone book program that stores the names and phone numbers of your friends/acquaintances in a file. Your program should have the abilities to: a. Add entries (na

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