Just starting and going through the sites 'c tutorial'
Hi:
I am very new to programming, and excited to learn C. I am starting the 'C tutorial' and I already have some questions after the first lesson.
Code:
#include <stdio.h>
int main()
{
int this_is_a_number;
printf( "Please enter a number: " );
scanf( "%d", &this_is_a_number );
printf( "You entered %d", this_is_a_number );
getchar();
return 0;
}
So when you use the '&' in the above example - the memory position/place is getting referenced, which holds the data and not the actual number 4?
When I do the following
Code:
printf("memory %p\n",this_is_a_number)
I receive 00000003
but when I do
Code:
printf("memory %p\n",&this_is_a_number);
I get the memory position.
Where or what is storying '00000003'? scanf required me to reference the pointer to
thank you