Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #12545

Re: Issues with combo of structures and arrays - Practice for a final exam

From 88888 Dihedral <dihedral88888@googlemail.com>
Newsgroups comp.lang.c++
Subject Re: Issues with combo of structures and arrays - Practice for a final exam
Date 2011-12-15 08:51 -0800
Organization http://groups.google.com
Message-ID <29476888.375.1323967893222.JavaMail.geo-discussion-forums@prfb7> (permalink)
References <18071799.15.1323818090821.JavaMail.geo-discussion-forums@yqnd19>

Show all headers | View raw


On Wednesday, December 14, 2011 7:14:50 AM UTC+8, Kebin wrote:
> Hey how's it hanging? I'm a student at PSU and I don't molest children. Maybe you can help me finish my code - it implements pretty much everything I need to know for my final tomorrow so help is much appreciated! 
> 
> http://www.mediafire.com/?x5and7k92cs0wa4
> 
> There a link to what I've done so far, and if you're sketched about downloading it go ahead and scan a million times and know that its just a cpp file which idk if you can even get viruses on those? Anyway check it out - the one problem I have currently is that the last function 
> 
> 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?!
> 
> Anyway, thanks for your time and potential help.
> 
> Good day to youuzzz

I suggest you change to the following style of most of your  functions:

int dosomething(T1 *input, T2 *output)

Please define the input  and output structures or classes of objects
clearly first. 

Of course call by reference is allowed in C++. 
But that's another just syntax sugar for kids again. 

  

Back to comp.lang.c++ | Previous | Next — Previous in thread | Find similar | Unroll thread


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