Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » implicit typecasting(implicit typecasting not available in eclipse luna....)
implicit typecasting [message #1418075] Sat, 06 September 2014 13:22 Go to next message
ABHIJIT KUMAR is currently offline ABHIJIT KUMARFriend
Messages: 1
Registered: September 2014
Junior Member
does implicit typecasting not available in eclipse luna.Here is my sample code and i am telling u the output what i get when i try to run this program.....

#include <stdio.h>
#include <stdlib.h>

int main(void) {
int x=3;
printf("%f",x);
return EXIT_SUCCESS;
}
the output should be 3.000000
but the output is 0.000000
  • Attachment: abhi.c
    (Size: 0.40KB, Downloaded 118 times)
Re: implicit typecasting [message #1418826 is a reply to message #1418075] Sun, 07 September 2014 18:19 Go to previous message
Tauno Voipio is currently offline Tauno VoipioFriend
Messages: 742
Registered: August 2014
Senior Member
This is actually a C language question, rather than an Eclipse question.

The compiler does not analyze the format string in your printf() function call. Thus, it cannot know that you want the second argument to be float/double, as it is not defined so in the printf() function prototype. Please note that this applies to all variable argument lists, using <stdarg.h> or <varargs.h>.


--

Tauno Voipio
Previous Topic:I want to install new software
Next Topic:Project specific file types not imported, if folder resource filter is used
Goto Forum:
  


Current Time: Thu Oct 03 23:15:31 GMT 2024

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

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

Back to the top