R
Rahul
Hi Everyone,
I read an article which claims that an invalid address ( not aligned
in power of two ) would cause a bus error exception, i tried the
following program and it didn't give any error,
int main()
{
int a = 10;
char *p = &a;
int *pp;
printf("%p\n",(void*)&a);
++p;
*p = 10;
pp = p;
printf("pp is %p and val %d\n",pp,*pp);
}
Am i missing something? How do i generate the bus error ?
Thanks in advance ! ! !
I read an article which claims that an invalid address ( not aligned
in power of two ) would cause a bus error exception, i tried the
following program and it didn't give any error,
int main()
{
int a = 10;
char *p = &a;
int *pp;
printf("%p\n",(void*)&a);
++p;
*p = 10;
pp = p;
printf("pp is %p and val %d\n",pp,*pp);
}
Am i missing something? How do i generate the bus error ?
Thanks in advance ! ! !