I don't see where the 2 comes from
#include<stdio.h> int main() { char *p="asdaddaddA";
printf("%d\n", sizeof(p) );
}
$ gcc pointers.cpp
$ ./a.out
4
titli_juit <[EMAIL PROTECTED]> wrote: char
*p="asdaddaddA";
printf("%d",sizeof(p));
the ans is 2 or 4 depending on compiler. can u plzz expalin why it
would be so? i think that the sizeof operator on a pointer type
variable returns size of the type of object pointer points to.
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
[Non-text portions of this message have been removed]