Skip to Main Content
Programming and Data Structures
book

Programming and Data Structures

by Ashok Kamthane
August 2009
Intermediate to advanced content levelIntermediate to advanced
604 pages
21h 39m
English
Pearson India
Content preview from Programming and Data Structures
Functions 331
p rin tf ("Sum ■ %d,r, * s ) ;
return 0;
}
*sum( )
I
int x,y,z,k;
printf("\n Enter three values
scanf ("% d %d %d”,&x,&y&z);
k & y + z ;
return (&k);
}
Explanation The function sum () is declared as a pointer function, that is, the function declared
as a pointer always returns a reference. The reference returned by the function sum () is assigned
to pointer *s. The pointer *s prints the sum.
10.6 CALL BY VALUE AND REFERENCE
There are two ways by which we can pass arguments to the function.
1) Call by value
2) Call by reference
1) Call by value: In this type values of the actual argument are passed to the formal argument
and ope ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Data Structures and Algorithms

Learning Data Structures and Algorithms

Rod Stephens
Data Structures and Algorithms in C++, Second Edition

Data Structures and Algorithms in C++, Second Edition

Michael T. Goodrich, Roberto Tamassia, David M. Mount

Publisher Resources

ISBN: 9789332506343