New Member FAQ | Forums | Earn Revenue


Resources Entrance Ask Experts Exam Papers Jobs English Projects Universities Colleges Courses Schools Training My India



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



C++ program - Demonstrates that default values can not be used in conjunction with Overloaded func.


Posted Date:     Total Responses: 0    Posted By: K Dinesh Reddy   Member Level: Diamond   Points/Cash: 5   




//C++ program - Demonstrates that default values can not be used in conjunction with Overloaded functions (PROGRAM DOESN'T COMPILE: Gives // // // Error)
#include
using namespace std;

int Volume(int, int=25, int = 1);
float Volume(float,float);

int main()
{
int length = 100, width = 50, height = 2;
int volume;
volume = Volume(length, width, height);
cout <<"First volume with all parameters = " << volume << endl;
volume = Volume(length, width);
cout <<"Second volume with one default = " << volume << endl;
volume = Volume(length,width);
cout <<"Third volume with two defaults = " << volume << endl;
cout << "Overloading example = " << Volume(45.0,4.5) << endl;
system ("pause");
return 0;
}

int Volume(int len, int wid, int hit)
{
return(len*wid*hit);
}

float Volume(float x, float y)
{
return(x/y);
}






Note: In the program, After #include "iostream" tag is there...
But it is not seen as the post is considered as a HTML post...
So please don't forget this point...
The original file is uploaded as attachment...
Check that also...



With Regards,
ZORO
IIT Madras - CSE





Project Feedbacks


No feedbacks found. Be the first to respond and make money from revenue sharing program.

Post Feedback
You must Sign In to post a feedback.
Next Project: C++ program - Demonstrates use of default parameter values
Previous Project: C++ program - Printing a sequence in Order

Return to Project Index

Post New Project


Related Projects



Advertise Here





Contact Us   Advertise   Editors    Privacy Policy    Terms Of Use   

ISC Technologies.
2006 - 2009 All Rights Reserved.