SyntaxFix
Write A Post
Hire A Developer
Questions
Try using the "%h" modifier:
"%h"
scanf("%hu", &length); ^
ISO/IEC 9899:201x - 7.21.6.1-7 Specifies that a following d , i , o , u , x , X , or n conversion specifier applies to an argument with type pointer to short or unsigned short.
ISO/IEC 9899:201x - 7.21.6.1-7
Specifies that a following d , i , o , u , x , X , or n conversion specifier applies to an argument with type pointer to short or unsigned short.