How do you use scanf to get an int in C?
问题 I'm trying to learn the benefits and shortcomings of different ways to get input from the console. I'm confused with scanf . Why do I need to use use &favNumber instead of favNumber ? I understand that &favNumber is the address location of favNumber , but why is it done this way? I feel like there's a type mismatch here where favNumber is an int and I'm telling scanf that it's a pointer to an int. I thought I wrapped my head around pointers but this is confusing me a bit. Any help would be