
II-274 Programming Concepts
struct book
{
char name[35];
char author[35];
int pages;
} b1;
void main()
{
------------
------------
show(&b1); /* Pass by address */
print(b1); /* Pass by value */
-------------
-------------
}
void show (struct book *b2) /* Pass by address */
{
------------
------------
}
void print (struct book b2) /* Pass by value */
{
------------
------------
}
OUTPUT:
Similarly, individual structure members can be passed to a function.
13. How are user-defined data types defined?
Ans: The statement typedef is to be used while defining the new user-defined data type. The
syntax is as follows:
typedef type dataname;
where type is the datatype ...