cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Pointer
Pointer
Jun 8, 2008 at 6:55pm UTC
ozgungor
(6)
#include <stdio.h>
#include <stdlib.h>
int main () {
int a;
printf("%p\n",a);
printf("%p",&a);
system("pause");
return 0;
}
when I run this programme , output shows 2 different addreses of a. What is their differance ? Thank you.
Jun 8, 2008 at 7:43pm UTC
bnbertha
(401)
In the first one you are passing the actual integer value (%p only applies formatting to the value you pass in). the second one you are passing the address which, by the sound of it is what you want..
Topic archived. No new replies allowed.