Thread: Does anyone??

  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...

  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 int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > 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.

  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
    4,632
    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