Hello, I have a quick question about using & and * when it comes to pointers and scanf.
If I have
Code:
int *ptr;
int a = 3, b;
What happens if I have
Code:
ptr = &b;
scanf("%d", &ptr);
where there's a & in front of the pointer
or
Code:
ptr = &b;
scanf("%d", *ptr);
where there's a * in front of the pointer?
I know that when you scan something into an array, you don't need the & because it's a pointer. So that means that when you scan something into a pointer, you don't need it. But what happens if you have a & or a * in front of ptr? Does * mean that the value that is scanned in s put into b?