I am currently working on a C program where I am trying to pass an pointer as an argument into a scanf
.
Example:
int main() {
int *num;
scanf("%d", num);
printf("%d", *num);
}
Considering that the typical scanf
passes in an address to store a value I don't see why it cannot store the address a pointer holds. I receive a memory error when I try to run this block of code. What could possibly be the issue?