Because C only has “pass-by-value” parameters, so to pass a ‘variable’ to put a value into, you have to pass its address (or a pointer to the variable).
More Related Contents:
- ‘ ‘, ‘\n’ , scanf() and output screen
- decimal of numbers in c
- scanf() not taking input from console [closed]
- How to read these mixture of data in C
- i get Error while trying to compile and Run, [Linker error] undefined reference to `scand’ [closed]
- Segmentation fault using scanf() [closed]
- scanf() leaves the newline character in the buffer
- fgets doesn’t work after scanf [duplicate]
- scanf Getting Skipped [duplicate]
- C skipping one command of a function? [duplicate]
- abnormal behavior of scanf [duplicate]
- using scanf(“%d “) with a space after the %d
- Difference between scanf and scanf_s
- Read no more than size of string with scanf()
- Why does scanf fail with floats?
- fgets instructions gets skipped.Why?
- scanf won’t ask for input the second time [duplicate]
- Reading a string with spaces with sscanf
- Difference between scanf(“%c”, &c) and scanf(” %c”, &c) [duplicate]
- How can I prevent scanf() to wait forever for an input character?
- Why scanf(“%d”, […]) does not consume ‘\n’? while scanf(“%c”) does?
- Scanf causes C program to crash
- using scanf function with pointers to character
- How can I fix the scanf to take data into the array?
- Format specifier in scanf for bool datatype in C
- Dynamic String Input – using scanf(“%as”)
- Why does scanf() need & operator (address-of) in some cases, and not others? [duplicate]
- Read int values from a text file in C
- scanf not working. need to read double from console
- Scan multiple integers without knowing the actual number of integers