On Sun, Dec 24, 2006 at 12:50:10AM +0530, Arun G Nair wrote:
> Hi,
>
> Am a bit confused by the output of the this C program:
>
> -ptr.c---
> #include
>
> int
> main()
> {
> int *ptr, x;
>
> x = 2;
> ptr = &x;
>
> pri
Thanx for the replies. Yeah, its pointing to itself.
x=2, *ptr=2, ptr=0xbfbfece0, &x=0xbfbfece0, &ptr=0xbfbfece4
x=2, *ptr=-1077941020, ptr=0xbfbfece4, &x=0xbfbfece0, &ptr=0xbfbfece4
x=2, *ptr=750764012, ptr=0xbfbfece5, &x=0xbfbfece0, &ptr=0xbfbfece4
Thanx once again.
-Arun
On 12/24/06, Otto Mo
> Am a bit confused by the output of the this C program:
>
> -ptr.c---
> #include
>
> int
> main()
> {
> int *ptr, x;
>
> x = 2;
> ptr = &x;
>
> printf("x=%d, *ptr=%d, ptr=%p, &x=%p\n", x, *ptr, ptr, &x);
>
> *ptr
On Sun, 24 Dec 2006, Arun G Nair wrote:
> Hi,
>
> Am a bit confused by the output of the this C program:
>
> -ptr.c---
> #include
>
> int
> main()
> {
> int *ptr, x;
>
> x = 2;
> ptr = &x;
>
> printf("x=%d, *ptr=%d,
Hi,
Am a bit confused by the output of the this C program:
-ptr.c---
#include
int
main()
{
int *ptr, x;
x = 2;
ptr = &x;
printf("x=%d, *ptr=%d, ptr=%p, &x=%p\n", x, *ptr, ptr, &x);
*ptr++;
printf("x=%d, *ptr=
5 matches
Mail list logo