On Dec 21, 2007 1:55 AM, p.angel88 <[EMAIL PROTECTED]> wrote:

> hi to all
> follows a program for call by value
> *********************************************************************
> #include<stdio.h>
> #include<conio.h>
> void swap(int,int);
> void main()
> {
> int a,b;
> clrscr();
> printf("enter two values");
> scanf("%d%d",&a,&b);
> printf("value before swapping a=%d & b=&d",a,b);
> swap(a,b);
> printf("value after swapping a=%d & b=%d",a,b);
> getch();
> }
> void swap(int x,int y)
> {
> int t;
> t=x;
> x=y;
> y=t;
> }

You aren't modifying the original values, only copies of those values
after they are passed into the function. What is your understadning of
'call by value'?

-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
    If I were to divulge it, it would overturn the world."
               -- Jelaleddin Rumi

Reply via email to