I got in my "main.cpp" the following code:
#include "rational.h"
using namespace std;
typedef struct rational {
long long numerator;
long long denominator;
} rational_t;
And I have a Header-file namend "rational.h":
#pragma once
rational add(rational a,rational b)
{
rational c;
c.numerator = a.numerator + b.numerator;
c.denominator = a.denominator + b.denominator;
return c;
}
I got an Error on Line:
rational add(rational a,rational b)
It gives me the following Error-Code: Fehler C4430 Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt. Translation: Error C4430 Missing Type specifier - int is accepted. "default-int" is not supported by C++.
I think because the function does not detect my struct properly. Can anyone pls help me?
Greetings, Nike