+ 1
Can I use Type Specifier of Long Double in C as %lf instead of %Lf?
Programming Language : C
2 odpowiedzi
+ 2
It appears to depend on the compiler you're targeting. I would use %Lf since it works in all c and c++ compilers that I could find it documented for.
Based on documentation https://linux.die.net/man/3/printf it should be capital %Lf.
Based on documentation with Visual c++ at https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2010/tcxf1dw6(v=vs.100) either case is fine. %Lf or %lf are both fine for Visual C++ 2010.
+ 1
Thanks