Thread: Problem with Operator Overloading

  1. #1
    Registered User
    Join Date
    Mar 2004

    Problem with Operator Overloading

    I've got already the formula but it is hard for me when talking of fraction:

    Addition : a/b + c/d = (a*d +b*c)/(b*d)
    Subtraction : a/b c/d = (a*d b*c)/b*d)
    Multiplication : a/b * c/d = (a*c)/(b*d)
    Division : a/b /c/d = (a *d) /( b*c)

    Here is the flow:

    The user should type the first fraction, an operator and a second fraction. The program should then display the result and ask if the user wants to continue. There should be checking the number from the user exceeds the normal range and move to type long; otherwise to double.

  2. #2
    I'm a little confused here. What exactly is your problem? What code have you written, and how does this relate to Operator Overloading?

    A few more specifics would be nice.
    "There's always another way"
    -lightatdawn (

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help understanding a problem
    By dnguyen1022 in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2009, 04:21 PM
  2. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  3. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  4. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  5. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM