S
somenath
Hi All,
I have one doubt regarding pointer .I have one small code as
mentioned bellow .
#include<stdio.h>
#include<stdlib.h>
int main (void)
{
int *p;
int *ptr= malloc(sizeof(int *));
return 0;
}
My doubt is if (sizeof(int *)); is undefined ? Because "p" is point
to any where .So when I try to dereference will it show undefined
behavior ?. I was expatiating it will crash .But in gcc version 3.2.2
20030222 (Red Hat Linux 3.2.2-5) not crashing .
Regards,
Somanath
I have one doubt regarding pointer .I have one small code as
mentioned bellow .
#include<stdio.h>
#include<stdlib.h>
int main (void)
{
int *p;
int *ptr= malloc(sizeof(int *));
return 0;
}
My doubt is if (sizeof(int *)); is undefined ? Because "p" is point
to any where .So when I try to dereference will it show undefined
behavior ?. I was expatiating it will crash .But in gcc version 3.2.2
20030222 (Red Hat Linux 3.2.2-5) not crashing .
Regards,
Somanath