problem in c..

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 s.
But in printf statement instead of *(pint+j) if use *(*p+j). Both will print values of s.
How *(pint+j)=*(*p+j)??
Can anyone explain it..?

Replies

  • Shashank Moghe
    Shashank Moghe
    Explicit typecasting, I believe? The question to follow is, whether it is necessary.
  • anksingla
    anksingla
    Shashank Moghe
    Explicit typecasting, I believe? The question to follow is, whether it is necessary.
    i also think so..but in a below program i got confused..
    int s[4][2]

You are reading an archived discussion.

Related Posts

Which type of motor is best suited to be used in a formula student electric racecar ?
Upcoming Events on Design in India: 1. UX India 2014 Conference, 7 -9 October 2014, Bangalore https://2014.ux-india.org/ 2. Workshop: Illustration for Fashion Design 8-10, October 2014, NID Ahmedabad Download 1...
https://www.embedded-know-how.com/chips-a-components/article/43-chips-components/1554#1784
Which type of motor is best suited to be used in a formula student electric racecar ?
I am a B.E(CSE) on 2013..i want to start my career as a php developer in kolkata..what is php career growth i can get in IT sector...after 1 or 2...