Pointer and Function & Call By Reference

Thursday, 8 September 2011

#include<stdio.h>
#include<conio.h>
void main()
{
void change(int *);
int a;
clrscr();
printf("Enter a number");
scanf("%d",&a);
change(&a);
printf("a=%d\n",a);
getch();
}
void change(int *p)
 {
  *p=*p+10;
 }


OUTPUT:


Enter a number 5
a=15

/*It automatically return the value*/






No comments:

Post a Comment

 

Blogger news

Blogroll

Enter your email address:

Delivered by FeedBurner

Total Pageviews

Followers

Most Reading