hi,

Basic idea of return is:


suppose two functions want to communicate..then there should be one
communicating medium...that medium is called return value.means it return
value from a function and give that return value to other function to
communicate.that's why every function has a return value.
example
additiion of two number:
#include<stdio.h>
int sum_num(int a,int b)
main()
{

int a,b,sum;
printf("enter two numbers");
scanf("%d%d",&a,&b);
sum=sum_num(a,b);
printf("sum of two number=%d",sum);

return 0;  //main is also a function.that's why it has return value
}
int sum_num(int a,int b)
{
int c;
c=a+b;
return c;    //or return(a+b);
}


in the above example...main function comunication with add_sum function with
return value.

return value may be pointer...u can search example...

On Thu, Jul 10, 2008 at 4:45 PM, andrew clarke <[EMAIL PROTECTED]> wrote:

>   On Thu 2008-07-10 12:07:57 UTC+0100, kathir resh (
> [EMAIL PROTECTED] <resh_personal%40yahoo.co.in>) wrote:
>
> > i am a begginner to c....i want to know about return statement in
> > detail... and what does the return do with o.s...........
>
> http://en.wikipedia.org/wiki/Return_statement
>  
>


[Non-text portions of this message have been removed]

Reply via email to