0
if i change %f to %d a new number appear i dont know why?
#include <stdio.h> int main() { const double PI = 3.14; printf("%f", PI); return 0; } if i change %f to %d a new number appear i dont know why?
3 Antworten
0
%d stands for decimal and it expects an argument of type int (or some smaller signed integer type that then gets promoted). Floating-point types float and double both get passed the same way (promoted to double) and both of them use %f.