Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C - C++ Learning > Re: how to use ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 7 Topic 4069 of 4295
Post > Topic >>

Re: how to use float in array of structure

by Bart van Ingen Schenau <bart@[EMAIL PROTECTED] > Mar 14, 2008 at 10:38 PM

juned2285@[EMAIL PROTECTED]
 wrote:

> while writing these codes, i face an error
>  struct st
> {
> char name[30];
> float per;
> }s[5];
> 
> when i use this structure, compiler gives the linking error.
> so how can i remove this error.

Some compilers do not link the floating point math library by default.
You could try to explicitly specify the math library to the linker.
Usually this is with the command-line option '-lm'.

If that does not help, please post the smallest complete program that
shows your problem (copy-past from your source file, do not retype) and
post the compiler output for that program as well.

Bart v Ingen Schenau
-- 
a.c.l.l.c-c++ FAQ: http://www.comeaucomputing.com/learn/faq
c.l.c FAQ: http://c-faq.com/
c.l.c++ FAQ: http://www.para****ft.com/c++-faq-lite/
 




 7 Posts in Topic:
how to use float in array of structure
juned2285@[EMAIL PROTECTE  2008-03-14 00:23:56 
Re: how to use float in array of structure
Richard Heathfield <rj  2008-03-14 08:22:24 
Re: how to use float in array of structure
Bart van Ingen Schenau &l  2008-03-14 22:38:56 
Re: how to use float in array of structure
juned2285@[EMAIL PROTECTE  2008-03-14 22:16:18 
Re: how to use float in array of structure
Richard Heathfield <rj  2008-03-15 07:22:48 
Re: how to use float in array of structure
"Jim Langston"   2008-03-15 00:51:20 
Re: how to use float in array of structure
Richard Heathfield <rj  2008-03-15 07:58:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 6 15:47:00 CDT 2008.