Type 'Test' could not be resolved
I'm starting to get annoyed by eclipse,there is nothing wrong here yet I'm getting an error
Type 'Test' could not be resolved
how can it not be resolved? I clearly declared a class named Test and did it before my main method.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
#include <iostream>
using namespace std;
class myException : public exception{
public:
virtual const char* what() const throw(){
return "something went wrong";
}
class Test{
public:
void goWrong(){
throw myException();
}
};
};
int main() {
Test test;
}
|
sorry guys forgot the closing brace and semi colon sloppy by me
Class
Test
is declared nested inside class
myException
.
In main, you could declare it like this:
Topic archived. No new replies allowed.