10.09.2013 Views

1. Advanced Data Structure using C++

1. Advanced Data Structure using C++

1. Advanced Data Structure using C++

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

LECTURE NOTES OF ADVANCED DATA STRUCTURE (MT-CSE 110)<br />

Call by Value and Call by Reference<br />

The arguments passed to function can be of two types namely<br />

<strong>1.</strong> Values passed<br />

2. Address passed<br />

The first type refers to call by value and the second type refers to call by<br />

reference.<br />

For instance consider program1<br />

main()<br />

{<br />

int x=50, y=70;<br />

interchange(x,y);<br />

printf(“x=%d y=%d”,x,y);<br />

}<br />

interchange(x1,y1)<br />

int x1,y1;<br />

{<br />

int z1;<br />

z1=x1;<br />

x1=y1;<br />

y1=z1;<br />

printf(“x1=%d y1=%d”,x1,y1);<br />

}<br />

Prepared By :­<br />

Er. Harvinder Singh<br />

Assist Prof., CSE, H.C.T.M (Kaithal) Page ‐ 62 ‐

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!