A
Arijit Mukherjee
All,
This piece of code works:
#include <stdio.h>
int main()
{
int abc[2][3] = {{1,2,3},{3,4,5}};
printf("The value of abc[2,2] %d\n", *((*abc) + 1));
}
While, this:
#include <stdio.h>
int main()
{
int abc[2][3] = {{1,2,3},{3,4,5}};
int **p = (int **)abc;
printf("The value of abc[2,2] %d\n", *((*p) + 1));
}
dumps core at printf.
Any reason why?
Thanks in anticipation,
Regards,
Arijit
This piece of code works:
#include <stdio.h>
int main()
{
int abc[2][3] = {{1,2,3},{3,4,5}};
printf("The value of abc[2,2] %d\n", *((*abc) + 1));
}
While, this:
#include <stdio.h>
int main()
{
int abc[2][3] = {{1,2,3},{3,4,5}};
int **p = (int **)abc;
printf("The value of abc[2,2] %d\n", *((*p) + 1));
}
dumps core at printf.
Any reason why?
Thanks in anticipation,
Regards,
Arijit