Like Tree2Likes
  • 1 Post By CommonTater

Does anyone??

This is a discussion on Does anyone?? within the C Programming forums, part of the General Programming Boards category; Does anyone know what linking the floating point format means... Following are a couple of functions which are said to ...

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    385

    Does anyone??

    Does anyone know what linking the floating point format means...

    Following are a couple of functions which are said to "link the floating point format" ??!!

    wtf!!

    Code:
    void link()
    {
    float f, *ff=&f;
    return f;
    }
    One more...

    Code:
    void linkfloat()
    {
    float a=0, *b;
    b=&a;
    a=*b;
    }

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Pick a descriptive thread title if you want us to take you seriously.

    All I see is someone making pointers to float values...
    Salem likes this.

  3. #3
    Registered User
    Join Date
    Aug 2011
    Posts
    385
    I found these functions in a couple of programs, and they don't seem to serve any purpose...

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by juice View Post
    I found these functions in a couple of programs, and they don't seem to serve any purpose...
    That's right, neither appears to do anything of value.

  5. #5
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Turbo C <Salem, turn your eyes away>, has a "smart" linker, which should automatically detect when your program needs the floating point package, linked into it. Unfortunately, it didn't work really well, so the code you show, was designed to force it into linking it in.

    If you don't need the floating point package, don't use those snippets of code in your program. If you do need it for your program (and aren't getting it), add those lines of code, just before your main function.

    This is for Turbo C ONLY.

  6. #6
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,668
    > Does anyone know what linking the floating point format means...
    Why are you
    a) still posting threads with rubbish titles?
    b) still using that ancient fossil TurboC (I thought you had gone all visual in another thread)
    c) not pasting your error messages into google?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  7. #7
    Registered User
    Join Date
    Aug 2011
    Posts
    385
    Quote Originally Posted by Salem View Post
    > Does anyone know what linking the floating point format means...
    Why are you
    a) still posting threads with rubbish titles?
    b) still using that ancient fossil TurboC (I thought you had gone all visual in another thread)
    c) not pasting your error messages into google?
    a) I thought it was a good title.
    b) I am not using turbo C. I just saw the code in a book and after wasting some time cerebrating about what it really does, I gave up and posted it.
    c) There was no error message.

  8. #8
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by Adak View Post
    Turbo C <Salem, turn your eyes away>, has a "smart" linker, which should automatically detect when your program needs the floating point package, linked into it. Unfortunately, it didn't work really well, so the code you show, was designed to force it into linking it in.

    If you don't need the floating point package, don't use those snippets of code in your program. If you do need it for your program (and aren't getting it), add those lines of code, just before your main function.

    This is for Turbo C ONLY.
    LOL... can't be all that smart if you have to use rubish code to make it load...

    Why not just #include <math.h>

  9. #9
    Registered User
    Join Date
    May 2010
    Posts
    2,804
    With Turbo-C just #including math.h will not force linking with the math library, you must actually use floating point numbers somewhere.

    Jim

  10. #10
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by juice View Post
    a) I thought it was a good title.
    A good title for this thread would be ...

    "Need help understanding odd functions"
    or maybe
    "Can you tell me what these functions do"

    Most people here do not read every thread so unless there is some hint of the thread's actual content, you've cut your readership to something like 1/3 just by being too butt lazy to type a couple of extra words.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21