Program of function overloading in c++ , C/C++ Programming

Program of function overloading:

class vector{

                private :

                int v[3];



                /*friend istream & operator >> (istream & ,vector &);*/ //overloading the

                                                                                                                //insertion operator

                                                                                                                // for the vector type object

                friend vector operator * (vector,int);

                friend vector operator * (int ,vector);


                vector()  dummy constructor



       vector (int *p);


                 void show();


                 }; // class termination


                /* istream & operator >>(istrream &din ,vector & b )


                                for( int i=0;i<3;i++)

                                                din >> b.v[i];

                                  return din;//for cascading




       vector operator *(vector a,int b)//function overloading

                                {          vector c;

                                                for(int i=0;i<3;i++)


                                  return c;



                vector operator *(int a,vector b)


                                vector c;

                                                for(int i=0;i<3;i++)


                                  return c;



      vector:: vector( int *p)


                                for(int i=0;i<3;i++)




                void vector ::show()


                                 for (int i=0;i<3;i++)

                                                cout << "\n"<



                void main()


                int t[]={ 1,2,3};

                vector a,b(t),c;









Posted Date: 10/18/2012 7:50:37 AM | Location : United States

Related Discussions:- Program of function overloading in c++ , Assignment Help, Ask Question on Program of function overloading in c++ , Get Answer, Expert's Help, Program of function overloading in c++ Discussions

Write discussion on Program of function overloading in c++
Your posts are moderated
Related Questions
Ask question #Minimum 100 words acceptedEducational Objectives: After completing this assignment, the student should be able to accomplish the following: Apply generic algorithms i

algorithm to find out all the factors of given positive integers determine the area of a triangle,rectangle and trapezium

Write algorithm and program for the conversion of a Tree to a Binary Tree

At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with thes

An experiment succeeds twice as often as it fails. Find the chance that in the next six trials there will be at least four successes.

A: A dangling pointer arises while you use the address of an object after its lifetime is end. It may occur in situations such as returning addresses of automatic variables from a

Can you help me with a C++ project?

Unlike C++, other programming languages have associative arrays that allow array indices to be strings instead of just integers. You are to create a template class, SVector, that i

padovan string program in java // aakash , suraj , prem sasi kumar kamaraj college program 1 : package test.padovanstring; public class PadovanString {     publ