How do I fix this error message in C++ programming?

Question by Ruthann Z: How do I fix this error message in C++ programming?
I am writing a source code, using user-defined functions, this is what my code looks like:

double average(double s1, double s2, double s3, double s4)
{
double sum;

sum = s1 + s2 + s3 + s4;

cout << sum/4.0 << endl; } this is embedded into a large source code, but when I got to compile my program an error pops up and says "error: too few arguments to function 'double average(double, double, double, double)' " how do I fix this? I am not sure what it means by too few arguments... so how can I fix this? i added the "return sum;" but how do I get it to not tell me about the too few arguments w/o changing the parameters in my function name? I fixed the original problem, now when I got to compile it, it wont print my cout statement. I am really bad with this stuff, it's confusing. Best answer:

Answer by Fudge
“too few” here means the function expects 4 argument ( aka parameters ) but u provided less than that ( for example , u provided 3 or 2 o r 1 )

Solution :
call the function with the correct number of arguments , which his 4 here

Aside note :
U declared the function as returning a double so add a return statement like this :

double average(double s1, double s2, double s3, double s4)
{
double sum;

sum = s1 + s2 + s3 + s4;

cout << sum/4.0 << endl; //HERE WHAT TO ADD return sum ; }

Know better? Leave your own answer in the comments!
Question by : How can I embed a video onto my website directly ?
There is a feature that allows me to upload a video into the web design program, but I want to be able to use html code to embed the video directly off my desktop onto the website. Does anyone know a website that I can copy the code for doing that or some instructions, please? Thanks

Best answer:

Answer by Baldingfast
I think you will be very happy when you visit this set-up wizard tool It gives you the embed code to simply cut and paste into tour web page. http://www.longtailvideo.com/support/jw-player-setup-wizard

If you want to check-out a free online marketing course I have just finished putting the final touches on it. You get access here: http://www.marketingfreecourse.com

Cheers

Dave

Know better? Leave your own answer in the comments!

Leave a Reply

Your email address will not be published. Required fields are marked *


*