I'm new to C. Given the following code,
int main(void)
{
int a;
scanf("%d",&a);
scanf("\n"); // consume trailing newline
}
As I understand it, the first declaration statement tells the compiler to allocate memory for an integer type variable with an identifier 'a' initialized to 0(as 'a==0'). Scanf needs a valid memory address to store the user input(say 5) so &a being the memory address of 'a' is where the user input is stored as 'a==5'. Is this the case or 'a' is stored as a variable name for the memory address and the contents of the address are simply 5?