0

I'm getting the error message "Error: expected initializer before 'sum' " from line 9 of my code when I try to compile my program. I can't seem to figure out why it would be throwing this error. Any help would be great. Thanks!

#include <iostream>
using namespace std;

struct Frac;
{
      int numerator;
      int denominator;
}
Frac sum(Frac& fract1, const Frac& fract2);
Frac Sub(Frac& fract1, const Frac& fract2);
Frac Mul(Frac& fract1, const Frac& fract2);
Frac Div(Frac& fract1, const Frac& fract2);

Edited by Towely: n/a

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Towely
1

haha common error!!

You forgot the semicolon on line 8 after the }
Structs always have a semicolon after the last bracket

so add the semicolon on line 8

};

Votes + Comments
Thanks duder
0

Oh wow, don't I feel sheepish! :)
Thanks for the help!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.