C++ Programming Blog

 
 
 

Image

 #include<iostream.h>
 #include<conio.h>

 int *function();

 main()
    {
       clrscr();

       int *p;

       p=function();

       cout<<\"\\n Value return by the function returning pointer :\"<<endl;
       cout<<\"\\t value of *p = \"<<*p<<endl;

       getch();
       return 0;
    }



 //---------------------------  function( )  -----------------------------//


 int *function()
    {
       int i=10;
       int *j;

       j=&i;

       return j;
    }

 
 
Didn't find what you were looking for? Find more on Program to illustrate the functions returning pointers