Program for Pointers and Array


    #include <iostream.h>
    #include <conio.h>
    void main ()
    {
        int array[5] = { 11, -2, 30, 41, 15 } ;
        int *pointer ;
        clrscr () ;
        pointer = &array[0] ;

        cout<<"The array elements are.....";
        while ( pointer < pointer + 5 )
        {
            cout<<*pointer<<"\n";
            pointer++ ;
        }
        getch () ;
    }

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|