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

  • SEARCH
  • Home
  • 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 9231371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:02:57+00:00 2026-06-18T06:02:57+00:00

I created a structure as: typedef struct { float real, img; } cmplx; And

  • 0

I created a structure as:

typedef struct {
  float real, img;
} cmplx;

And I created a function as

void input(cmplx *a) {
  scanf("%f + %f i", &a->real, &a->img); 
}

and called the function from main as:

cmplx a;
input(&a);

The execution stops when the scanf is reached. If floats are replaced by ints, the problem is solved. What is this behaviour? Is there a way I can use floats for my problem?

The program was compiled in Turbo C, in Windows XP.

  • 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-06-18T06:02:59+00:00Added an answer on June 18, 2026 at 6:02 am

    It is hard to answer without knowing the error message that your program’s execution stops with, but from your comment “is there any code i can write to tell compiler to link floating point library”,
    I suspect it may be this issue:

    “Floating point formats not linked” is a Borland run-time error (Borland
    C or C++, Turbo C or C++). 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. One common case is where you don’t call any
    f-p functions, but you have %f or other f-p formats in scanf() or
    printf() calls. The cure is to call an f-p function, or at least force
    one to be present in the link.

    To do that, define this function somewhere in a source file but don’t
    call it:

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

    It doesn’t have to be in the module with the main program, as long as
    it’s in a module that will be included in the link.

    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
    

    Using this workaround, or a more modern compiler, will probably fix your issue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created a structure like this typedef struct Node { NSString* Description; NSString* AE;
I have created following structure 'data' in C typedef struct data { double *dattr;
I've created a structure in a header file as follows: typedef struct { GLfloat
I have a structure typedef struct myStruct_st { int a; }myStruct; It can be
I have the following structure, typedef struct _MainWin { GtkWindow parent; GtkWidget* scroll; GtkWidget*
This is the def of my structure typedef struct treeNode { int data,pos; char
Would this be the proper way to extend a structure array? typedef struct {
I can declare a structure: typedef struct { int var1; int var2; int var3;
I wrote a simple counter structure in C: typedef struct{ int value; }Counter; then,
I have this structure: typedef struct { char *str; ... } nameType; I create

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.