google search

Popular Posts


Welcome to BCA Notes

>>>>>>>>>>>>>>>>

Visitors

Search This Blog

Blogger templates

Visitor Map


Thursday, 20 March 2014

Passing Pointer to an Array

#include<iostream.h>
main()
{
int a[5];
int *pt;
pt=a;
*pt=a[0]=10;
pt++;
*pt=a[1]=20;
pt++;
*pt=a[2]=30;
pt++;
*pt=a[3]=40;
pt++;
*pt=a[4]=50;
pt++;
for ( int i=0;i!=5;i++)
{
cout<<a[i]<<"\n";
}


}

0 comments:

Post a Comment