Structures not working correctly?
<pre><code>Fraction AddFractions(const Fraction&amp; frac1, const Fraction&amp; frac2)
{
    Fraction frac3;

    if (frac1.denom == frac2.denom)
    {
        frac3.num = frac1.num + frac2.num;
        frac3.denom = frac1.denom;          
    }
    else
    {
        frac3.denom = (frac1.denom * frac2.denom);
        frac3.num = (frac1.num * frac2.denom) + (frac2.num * frac1.denom);          
    }
    return frac3;
}
</code></pre>

<p>This is my prototype and there is a structure defined as <code>Fraction</code> with <code>int num</code> and <code>int denom</code> when I call the function it just gives me back garbage? I don't know what's wrong with it.  Please help. =(</p>

<pre><code>    cout &lt;&lt; "Please enter two Fractions" &lt;&lt; endl;
    cout &lt;&lt; endl;
    GetFraction(frac1); 
    cout &lt;&lt; "Your fisrt fraction is: ";
    PrintFraction(frac1);
    cout &lt;&lt; endl;
    cout &lt;&lt; endl;
    GetFraction(frac2);
    cout &lt;&lt; "Your second fraction is: ";
    PrintFraction(frac2);
    cout &lt;&lt; endl;


    do
    {
        choice1 = MathMenu();
        if (choice1 == ErrorOpt)
        {
            cout &lt;&lt; "There was an error with what you have entered" &lt;&lt; endl;
        }
        else if(choice1 != QuitOpt)
        {

            // do the math options 
            switch (choice1)
            {
            case AddOpt:
                AddFractions(frac1, frac2);
                break;
            case SubtractOpt:
                SubtractFractions(frac1, frac2);
                break;
            case MultiplyOpt:
                MultiplyFractions(frac1, frac2);
                break;
            case DivideOpt:
                DivideFractions(frac1, frac2);
                break;
            }
            //print the results 
            PrintFraction(frac1);
            PrintMathOption(choice1);
            PrintFraction(frac2);
            cout &lt;&lt; " = ";
            Standardize(frac3);
            Reduce(frac3);
            PrintFraction(frac3);
            cout &lt;&lt; endl;
            Pause();
</code></pre>
