I have some errors popped up when attempting to compile the files. I'm using a header file, which is imported to the implementation file. The header file pretty much declares every variable and the implementation file is just me putting in the function definitions, etc
i defined the variable "Body" as a class in both the header file and implementation file without realizing it and the compiler points it out as an error of "redefinition" while attempting to compile.
Therefore, I eliminated the variable type "class" next to the variable "Body" in the implementation file and I get this error message
"error: expected unqualified-id before '{' token"
I don't really know what to do here and I'm not understanding why it's saying that.
Body. h
class Body
{
//code here
}
___________
Body.cpp
Body
{
// code here
}
this is a sample of what I recently did before I got this recent error message. I showed both the header file and the implementation file content or layout.
class Body {
Body ();
void foo ( int bar = 42 );
};
___________
// implementations
Body::Body ()
{
// code of default constructor
}
void Body::foo( int bar )
{
// code
}