Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #12501
| From | David Harmon <source@netcom.com> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: Issues with combo of structures and arrays - Practice for a final exam |
| Date | 2011-12-14 07:47 -0800 |
| Organization | I support http://www.answers.com/topic/boulder-pledge |
| References | <18071799.15.1323818090821.JavaMail.geo-discussion-forums@yqnd19> |
| Message-ID | <mvidnccEmLaCWHXTnZ2dnUVZ_o-dnZ2d@earthlink.com> (permalink) |
On Tue, 13 Dec 2011 15:14:50 -0800 (PST) in comp.lang.c++, Kebin
<k.dulce.21@gmail.com> wrote,
>
>void AverageTotal (Book index[],int s,double avg,double sum)
>{
> int i;
>
> for (i=0; i<s; i++)
> {
> sum = sum + index[i].cost;
> }
> avg = sum / i+1;
>}
>
>That is designed to find avg and total of the books is not returning anything but 0. Maybe you can find out why?!
Maybe because "void" functions cannot return anything?
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Issues with combo of structures and arrays - Practice for a final exam Kebin <k.dulce.21@gmail.com> - 2011-12-13 15:14 -0800 Re: Issues with combo of structures and arrays - Practice for a final exam "MikeWhy" <boat042-nospam@yahoo.com> - 2011-12-13 18:18 -0600 Re: Issues with combo of structures and arrays - Practice for a final exam Christopher <cpisz@austin.rr.com> - 2011-12-14 00:00 -0800 Re: Issues with combo of structures and arrays - Practice for a final exam Tobias Müller <troplin@bluewin.ch> - 2011-12-14 09:53 +0000 Re: Issues with combo of structures and arrays - Practice for a final exam David Harmon <source@netcom.com> - 2011-12-14 07:47 -0800 Re: Issues with combo of structures and arrays - Practice for a final exam 88888 Dihedral <dihedral88888@googlemail.com> - 2011-12-15 08:51 -0800
csiph-web