about floating point

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

Accepted Solution

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 :
LVL 12

Expert Comment

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);

Expert Comment

ID: 17057221

Expert Comment

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

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

Suggested Solutions

Title # Comments Views Activity
Test against App 49 138
Finding a good hash function 4 127
Windows Updates failing due to Diskpart not configured correctly 8 130
What is atomic operation? 6 64
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
This tutorial is posted by Aaron Wojnowski, administrator at  To view more iPhone tutorials, visit This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

856 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