CrazyEngineers
  • problem in c program..

    anksingla

    Member

    Updated: Oct 23, 2024
    Views: 1.1K
    Below program is to print the values of 2d array s.

    int s[][2]={12,1,13,214,3};

    int i,j;
    int (*p)[2];
    int *pint;
    For(i=0;i<3;++i)
    {
    p=&s;
    pint=(int*)p;
    for(j=0;j<2;++j)
    printf("%d",*(pint+j));
    }
    This will print values stored in array .
    In the above program in printf statement we use *(pint+j) which prints value.
    But if *(*p+j) is use instead of *(pint+j), then also program remains same.
    Is this means pint=*p ??
    How *(*p+j) works same as *(pint+j)??
    Can anyone explain..?
    0
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Home Channels Search Login Register