Pointers in C
- From: "Praveen" <rpraveen1982@xxxxxxxxx>
- Date: 20 Feb 2007 22:11:01 -0800
Hi,
I came across a program as follows
main()
{
int x, y ;
int *p1 = &x;
int *p2 = &y;
printf("%d\n", p1-p2);
}
The output of the above program is 1.
Can some one explain me how it is 1.
Thanks in advance.
.
- Follow-Ups:
- Re: Pointers in C
- From: Daniel Rudy
- Re: Pointers in C
- From: rafalp
- Re: Pointers in C
- From: Richard Heathfield
- Re: Pointers in C
- From: Ian Collins
- Re: Pointers in C
- Prev by Date: Re: Compiler Error
- Next by Date: Re: Pointers in C
- Previous by thread: switch not working
- Next by thread: Re: Pointers in C
- Index(es):