I am returning to C++ from a long hiatus programming in other languages, and I switched by compiler (g++) to use the C++11 std. I got off to a rough start do to receiving an error.
Expected Output:
The class instantizes as an object
Actual Output (error):
error: expected primary-expression before ‘myObject’
|| Obsolete
//MyClass.h
class MyClass {
public:
MyClass();
virtual ~MyClass();
};
//MyClass.cpp
class MyClass {
public:
MyClass(void) {
return;
}
~MyClass() {
return;
}
}
//Program.cpp
#include "MyClass.h"
int main(int argc, char *argv[]) {
MyClass myObject; // <-- Error occurs here: error: expected primary-expression before ‘myObject’
return 0;
}
||