HI friends,
Suppose for the the following (using the "gcc" compiler) -
Please note- Underlining used only to draw your kind attention to my precise
question which follows shortly.
1. int main()
{
int c[5]={1,2,3,4,5};
*int *p=c;* //For this
code gcc compiles normally without any error or problem
//some lines of code
return 0;
}
2. int main()
{
int c[5]={1,2,3,4,5};
*int *p;*
**p=c;* //GCC gives a
typecast error (ofcourse). Even if I do * ***p=(int) c,* gcc gives me a
Segmentation fault later but no typecast error
//some lines of code
return 0;
}
I am slighttly confused in the explantion of this. I mean how does the
compiler interpret these two statements differently although apparentely
(just my mere look, they seem to do the same thing).
I would appreciate if someone could explain the differece between
compiler's interpretation for the above underlined statements. Thanks in
advance.
--
Hermes
Think Free, Think Open Source
_______________________________________________
Users mailing list
[email protected]
http://lists.dgplug.org/listinfo.cgi/users-dgplug.org