Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » printf not accepting %Lf
printf not accepting %Lf [message #1166246] Fri, 01 November 2013 21:57 Go to next message
Bencini . is currently offline Bencini .Friend
Messages: 1
Registered: November 2013
Junior Member
Hey Guys, this my first post and I am quite excited to start learning C for my university course. Just FYI I have no background knowledge, I come from a long education of sports and the natural sciences... so please bare with me.. remember we were all new once.

My question revolves around the use of printing long double floats.

Basically this is my code

#include <stdio.h>
int main(void)

{
double dip = 2.32e-5;
long double trip = 53.232;
printf("%f can be written as %e\n", dip, dip);
printf("%Lf can be written as %Le", trip, trip);
return 0;
}
Eclipse tells me this for my 2nd printf

''Multiple markers at this line
- too many arguments for format [-Wformat-extra-args]
- unknown conversion type character 'L' in format [-
Wformat=]''

and obviously when i see the the output , that particular line is random rubbish (in terms of numbers shown)

What could be the problem?

(also I am using C primer plus by Prata to learn C)
Re: printf not accepting %Lf [message #1167320 is a reply to message #1166246] Sat, 02 November 2013 15:24 Go to previous message
Joost Kraaijeveld is currently offline Joost KraaijeveldFriend
Messages: 273
Registered: July 2009
Senior Member
Maybe the answer could be found here:

http://en.cppreference.com/w/cpp/io/c/fprintf

Gr

Joost


Cheers,

Joost
Previous Topic:Refreshing the file list
Next Topic:CDT Internal Builder G++ Version
Goto Forum:
  


Current Time: Sat Apr 27 01:47:08 GMT 2024

Powered by FUDForum. Page generated in 0.03619 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top