Click Here for Assignment(pdf format).........
Showing posts with label Structure. Show all posts
Showing posts with label Structure. Show all posts
Tuesday, April 22, 2008
Assignment : Structure in C++
Posting the assignment on structure (User defined Data type). The questions are to be done in assignment register.
Click Here for Assignment(pdf format).........
Click Here for Assignment(pdf format).........
User Defined Data Type in C++ : Structure
Structures in C++
A structure is a group of data elements grouped together under one name. These data elements, known as members, can have different types and different lengths. Structures are declared in C++ using the following syntax: struct structure_name
{
member_type1 member_name1;
member_type2 member_name2;
member_type3 member_name3;
:
:
} object_names;
example :
struct product
{
int weight;
float price;
} ;
product apple;
product banana, melon;
Subtopics Covered
Defining a Structure
Declaring structure variables
Accessing structure elements
Passing structure to Functions as value and reference argument/parameter
Function returning structure
Array of structures
passing an array of structure as an argument/ a parameter to a function
Subscribe to:
Posts (Atom)