Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7038807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:42:49+00:00 2026-05-28T01:42:49+00:00

I have a struct that contains a float var. I am trying to read

  • 0

I have a struct that contains a float var. I am trying to read the value using a pointer to a struct. Here’s the code:

struct mas {
    float m;
};

int main(void)
{
    struct mas *ms;
    ms=(struct mas*)malloc(sizeof(struct mas));
    scanf("%f",&(ms->m));
    printf("%f",ms->m);
    return 0;
}

But running the program produces the following error:

scanf floating point formats not linked

The compiler used is Borland Turbo C++ (3.0) on a Windows PC. Why is this so?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:42:50+00:00Added an answer on May 28, 2026 at 1:42 am

    This might be helpful: http://www.faqs.org/faqs/msdos-programmer-faq/part2/section-5.html

    From the article:

    Borland’s compilers try to be smart and not
    link in the floating- point (f-p) library unless you need it. Alas, they
    all get the decision wrong. … (To force them to link it) define this function somewhere in a source file but don’t
    call it:

    static void forcefloat(float *p)
    {
      float f = *p;
      forcefloat(&f);
    }
    

    Also:

    If you have Borland C++ 3.0, the README file documents a slightly less
    ugly work-around. Insert these statements in your program:

     extern unsigned _floatconvert;
     #pragma extref _floatconvert
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a code that looks something like: struct Data { int value; };
I have a struct that contains pointers: struct foo { char* f; int* d;
I have a dll which accepts a struct that contains a pointer to a
I have a C struct that contains a function pointer. Now, I have used
Let's say I have a struct that contains local environments: public struct Environments {
I have a function that takes a struct, and I'm trying to store its
Long story short, I have a struct (see below) that contains exactly one field:
I have a struct that contains two lists: struct MonthData { public List<DataRow> Frontline;
When you need to have very small objects, say that contains 2 float property,
Quick question... Suppose I have a C# struct that contains a single reference member.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.