445,852 Members | 2,240 Online Need help? Post your question and get tips & solutions from a community of 445,852 IT Pros & Developers. It's quick & easy.

# PLEASE I need a Quick HELP

 P: 5 Hello ... Now , When I write this massege I feel with a huge disappointment becouse I waste 6 houers to konow what is the Problem with this code . The I didn't write the hole code , becouse every thing was Ok Until I want to OverLoad the + operation using friend function , the compiler give me this massege : INTERNAL COMPILER ERROR The binfit of the programe is to add Fraction using class and the overload all the artheamtic operations I need help please , becouse I have to complete it befoe Saturday and I have also MATH MAJOR --------------------------------------------- This is .h file : #include using namespace std ; class Fraction { private : double numerator ; double denominator ; public : friend Fraction operator +(Fraction &a , Fraction &b ) ; Fraction () ; Fraction ( double x , double y ) ; bool zero () ; bool infinite () ; void print () ; void print_decimal () ; friend istream &operator>> ( istream &ins , Fraction &f ) { cout << "Enter the Fraction " << endl; ins >> f.numerator ; ins >> f.denominator ; return ins ; } }; ------------------------------------- This is .cpp file : ///////// Fraction.cpp /////// /////////////////////////////// #include #include #include "Fraction.h" using namespace std ; Fraction::Fraction() { numerator = 1 ; denominator = 1 ; } Fraction::Fraction ( double x , double y ) { numerator = x ; denominator = y ; } bool Fraction::zero() { if ( numerator == 0 ) return 0 ; else return ( false ) ; } bool Fraction::infinite () { if ( denominator == 0 ) return ( true ) ; else return ( false ) ; } void Fraction:rint () { if ( infinite () == true ) cout << " oo " << endl; else cout << "Fraction as fraction " << setw(5) << "==" << setw(5) << numerator << "/" << denominator << endl; } void Fraction:rint_decimal () { cout << "Fraction as dicimal " << setw(5) << "==" << setw(5) << numerator / denominator << endl; } Fraction operator+(const Fraction &a , const Fraction &b) { Fraction tempC; tempC.numerator =a.numerator +b.numerator; tempC.denomerator=a.denomerator+b.denomerator; return tempC; } ///////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////// //I tryed to Overload >> by this way , But it was filled !!!!! /////////////////////////////////////////////////////////////// //Fraction Fraction:perator >>(istream &ins ) ///{ // Fraction f ; /// // cout << "Enter Fraction " << endl; // ins >> f.numerator ; // ins >> f.denominator ; // // return f ; //} Mar 22 '07 #1
6 Replies

 P: 99 ok, first, if youre going to ask us for help, do NOT start by saying what a disappointment it is that it will take so long. (i dont know about others, but i personally will require an apology before helping you.) Mar 22 '07 #2

 P: 5 ok, first, if youre going to ask us for help, do NOT start by saying what a disappointment it is that it will take so long. (i dont know about others, but i personally will require an apology before helping you.) Ok ... I'm sorry ... now please give me what you have .. Thanks Mar 23 '07 #3 