main()
{
char ch [10];
int I, l;
printf(“Enter string \n”);
gets ( ch);
l= strlen (ch);
printf(“In reverse order \n”);
for( i=l; i>=0; i- -)
printf(“%c\n”,ch [i]);
}
Declare pointer of pointer
Example
Main()
{int x=20;
int *px;
px =&x;
print{“%d”,*px);
}
Proto typing
Int *a ,b ,c;
B=10;
A=&b;
C=*a;
Pointer to function
Example
Main()
{
int display ( );
func-ptr =display ;
printf(“address of function display is %, fun-ptr”);
}
int display ( )
{
puts (“Wasim javed \n”);
}
Swap Function
(1) Function swap(int a, int b);
{
int temp;
temp =a;
a =b;
b= temp;
}
(2) function swap (int*a, int*bb);
{
int temp;
temp =*a;
*a =*b;
*b = temp;
}
Posted by: Wasim Javed
No comments:
Post a Comment