Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Floating point formats not linked

Reply
Thread Tools

Floating point formats not linked

 
 
Ravi
Guest
Posts: n/a
 
      11-08-2003
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[i].name,&e[i].sal);
for (i=0;i<=0;i++)
printf("%s %f",e[i].name,e[i].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;}
 
Reply With Quote
 
 
 
 
Malcolm
Guest
Posts: n/a
 
      11-08-2003

"Ravi" <(E-Mail Removed)> 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[i].name,&e[i].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[i].name,e[i].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.


 
Reply With Quote
 
 
 
 
NFish
Guest
Posts: n/a
 
      11-08-2003
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[i].name,&e[i].sal);
> for (i=0;i<=0;i++)
> printf("%s %f",e[i].name,e[i].sal);
>
>
> return 0;
> }
>



This is a FAQ.

http://www.eskimo.com/~scs/C-faq/q14.13.html

 
Reply With Quote
 
Mark McIntyre
Guest
Posts: n/a
 
      11-08-2003
On Sat, 08 Nov 2003 23:06:40 +0530, in comp.lang.c , Ravi
<(E-Mail Removed)> 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 =---
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Share-Point-2010 ,Share-Point -2010 Training , Share-point-2010Hyderabad , Share-point-2010 Institute Saraswati lakki ASP .Net 0 01-06-2012 06:39 AM
Accessing array elements via floating point formats. Skybuck Flying C Programming 33 12-17-2010 10:51 PM
Catching floating point errors from linked C code John Pye Python 4 01-25-2007 11:53 PM
floating point problem... floating indeed :( teeshift Ruby 2 12-01-2006 01:16 AM
Floating Point Formats are not linked neha C Programming 8 08-03-2006 06:28 PM



Advertisments