scanf requires the addresses of the variables to be passed to it. Replace your scanf by
scanf("%d %d",&hour,&min);
You should be good to go.
More Related Contents:
- ‘ ‘, ‘\n’ , scanf() and output screen
- Making an array using pointers in c
- sscanf Beginner in C
- i get Error while trying to compile and Run, [Linker error] undefined reference to `scand’ [closed]
- Segmentation fault using scanf() [closed]
- What is the effect of trailing white space in a scanf() format string?
- How to prevent scanf causing a buffer overflow in C?
- Why does scanf() need “%lf” for doubles, when printf() is okay with just “%f”?
- C – scanf() vs gets() vs fgets()
- Scanf skips every other while loop in C
- Reading in double values with scanf in c
- scanf regex – C
- Why scanf must take the address of operator
- fgets instructions gets skipped.Why?
- 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?
- casting char[][] to char** causes segfault?
- Why scanf(“%d”, […]) does not consume ‘\n’? while scanf(“%c”) does?
- Scanf causes C program to crash
- using scanf function with pointers to character
- Segmentation Fault before main
- How can I fix the scanf to take data into the array?
- Returning this pointer from a function
- Format specifier in scanf for bool datatype in C
- Why does scanf() need & operator (address-of) in some cases, and not others? [duplicate]
- whitespace in the format string (scanf)
- How do the puts and gets functions work?
- How do you read scanf until EOF in C?
- What is the difference between %f and %lf in C?