Floating point formats not linked

Discussion in 'C Programming' started by Ravi, Nov 8, 2003.

  1. Ravi

    Ravi Guest

    Is there anything wrong with this program?

    #include <stdio.h>

    int main()
    {
    struct emp
    {
    char name[20];
    float sal;
    };

    struct emp e[1];
    int i;
    for (i=0;i<=0;i++)
    scanf("%s %f",e.name,&e.sal);
    for (i=0;i<=0;i++)
    printf("%s %f",e.name,e.sal);


    return 0;
    }

    --
    main(){char s[37]="CSbwjAjocpy/mw!PS!sbwjAeftqbnnfe/dpn";
    int i;for(i=0;i<36;putchar(s[i++]-1));return 0;}
     
    Ravi, Nov 8, 2003
    #1
    1. Advertising

  2. Ravi

    Malcolm Guest

    "Ravi" <> wrote in message
    >
    > Is there anything wrong with this program?
    >
    > #include <stdio.h>
    >
    > int main()
    > {
    > struct emp
    > {
    > char name[20];
    > float sal;
    > };
    >
    > struct emp e[1];
    > int i;
    >
    > for (i=0;i<=0;i++)
    > scanf("%s %f",e.name,&e.sal);
    >

    The loop is a bit confusing. Also scanf("%s", buff) is gets() in disguise.
    >
    > for (i=0;i<=0;i++)
    > printf("%s %f",e.name,e.sal);
    >
    > return 0;
    > }
    >

    If you are getting an error saying "floating point formats not linked" it
    probably means that you are using a compiler for some small system where
    floating point arithmetic is not included by default. You will have to look
    at the documentation to see how to tell it to accept floats.
     
    Malcolm, Nov 8, 2003
    #2
    1. Advertising

  3. Ravi

    NFish Guest

    Ravi wrote:

    > Is there anything wrong with this program?
    >
    > #include <stdio.h>
    >
    > int main()
    > {
    > struct emp
    > {
    > char name[20];
    > float sal;
    > };
    >
    > struct emp e[1];
    > int i;
    > for (i=0;i<=0;i++)
    > scanf("%s %f",e.name,&e.sal);
    > for (i=0;i<=0;i++)
    > printf("%s %f",e.name,e.sal);
    >
    >
    > return 0;
    > }
    >



    This is a FAQ.

    http://www.eskimo.com/~scs/C-faq/q14.13.html
     
    NFish, Nov 8, 2003
    #3
  4. On Sat, 08 Nov 2003 23:06:40 +0530, in comp.lang.c , Ravi
    <> wrote:

    >Is there anything wrong with this program?


    Try FAQ 14.13


    --
    Mark McIntyre
    CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
    CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>


    ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
    ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
     
    Mark McIntyre, Nov 8, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Pye
    Replies:
    4
    Views:
    401
    John Pye
    Jan 25, 2007
  2. neha

    Floating Point Formats are not linked

    neha, Aug 1, 2006, in forum: C Programming
    Replies:
    8
    Views:
    859
  3. Skybuck Flying

    Accessing array elements via floating point formats.

    Skybuck Flying, Dec 10, 2010, in forum: C Programming
    Replies:
    33
    Views:
    1,053
    Andrew Reilly
    Dec 17, 2010
  4. Saraswati lakki
    Replies:
    0
    Views:
    1,412
    Saraswati lakki
    Jan 6, 2012
  5. teeshift
    Replies:
    2
    Views:
    291
    Chris Pearl
    Dec 1, 2006
Loading...

Share This Page