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

Programing solution, write a program that declares and initializes 2 intege...

write a program that declares and initializes 2 integer variable a and b with the value 35 and 14, and displays and calculates their sum,product,quotient and real division result.t

Function with two arguments, Write out pseudocode for a function called "an...

Write out pseudocode for a function called "and" that takes two arguments, both booleans, and returns the logical and of the inputs. DO NOT use the logical and operator: instead, w

Algorithm, Sine function computation

Sine function computation

Explain input output function, Input Output Most languages have "statem...

Input Output Most languages have "statements" to perform I/O . Though in C and C++ we use "functions" to perform I/O. C++ also has its own I/O mechanism - the cin and cout obje

Define some important point for bit fields with structures, Define some Imp...

Define some Important Point for bit fields with structures? Only n lower bits will be assigned to an n bit number thus type cannot take values larger than 15 (4 bits long)

Program, c | c-c-c-c-c | c-c-C-c-c | ...

c | c-c-c-c-c | c-c-C-c-c | c find distance between difftent carbon atom by programing

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