• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 291
  • Last Modified:

about floating point

why the error scanf:floating point formats not linked occur during run time & what's the solution for that
0
anuraggupta1
Asked:
anuraggupta1
1 Solution
 
Infinity08Commented:
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
 
rajeev_devinCommented:
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
 
kaliyugkaarjunCommented:
0
 
nafis_devlprCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The Lifecycle Approach to Managing Security Policy

Managing application connectivity and security policies can be achieved more effectively when following a framework that automates repeatable processes and ensures that the right activities are performed in the right order.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now