Monday, September 12, 2011

Pointers to array

main()
{
    int a[][4]={ 5,6,7,8,
             1,2,3,4,
             2,3,4,5
             };
    int *p;
    int (*q)[4];  // q is a pointer to an array of 4 integer
    clrscr();
    p=a;
    q=a;
    printf("\n Add. of :p=%u ,q=%u",p,q);
    p++;
    q++;
    printf("\n New Add. of :p=%u ,q=%u",p,q);
    getch();
}

No comments:

Post a Comment

Popular 5 Posts Last 7 days