i had declared in main,
{
int i=o;
char *x;
for(....)
{...
.....
}
..
...
}
i got segmentation fault.
i put int i; after removing the assignment i.e. =0
(no other modifications in pgm.)
i still got segmentation fault.
then i put int i; below the declaration char *x;
the pgm worked fine...
When i declared int i=o in the C program in UNIX
i got segmentation fault but when i removed the value assignment i still got that message.
when i moved the declaration int i three lines below it did not give me the error.
can anyone tell me why?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.