scanf format warning for double

前端 未结 4 1549
隐瞒了意图╮
隐瞒了意图╮ 2021-01-26 16:46

I\'m having a small problem with a program I\'m working on, I keep getting the warning format \'%1f\' expects type \'float *\' but argument 2 has type \'double *\'

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-26 17:01

    Use correct format specifiers for their respective data types

    • float %f
    • double %lf
    • int %d or %i
    • unsigned int %u
    • char %c
    • char * %s
    • long int %ld
    • long long int %lld

提交回复
热议问题