Solved

about floating point

Posted on 2006-07-06
6
280 Views
Last Modified: 2010-04-15
why the error scanf:floating point formats not linked occur during run time & what's the solution for that
0
Comment
Question by:anuraggupta1
6 Comments
 
LVL 53

Accepted Solution

by:
Infinity08 earned 20 total points
ID: 17056429
This is for a Borland compiler I guess ?

The problem is that it optimizes the floating point library out when no floating points are used. However, it doesn't see the %f's in a scanf for example. It's a problem with the compiler.

To fix, check this page :

http://www.faqs.org/faqs/msdos-programmer-faq/part2/section-5.html
0
 
LVL 12

Expert Comment

by:rajeev_devin
ID: 17056564
This problem also persists in other compiler.

You can fix this problem by initializing the float variables that you use in scanf.

Something like this
float f = 0.0f;
...
scanf("%f", &f);
0
 
LVL 8

Expert Comment

by:kaliyugkaarjun
ID: 17057221
0
 
LVL 7

Expert Comment

by:nafis_devlpr
ID: 17098226
you should use double instead of float, thats more reliable and error free. However for your problem initialize the float first then scan it
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now