Question 1: How to acces a class

Well I did it like I learned it in a Tutorial, but it didn't work.
I made my class outside my main.ccp. So I have the headerfile of my class 'Example' (example.h) and the other one (example.cpp). Inside the example.cpp, I now create following void function:

1
2
3
4
void Example::Voidex ( )
{
    cout << "hi" << endl;
}

In the headerfile, I write under public:

void voidex ( );


I include 'example.h' (#include 'example.h') to my main.cpp and write following:

1
2
3
4
5
int main( )
{
    Example MyObject;
    MyObject.voidex( );
}

Well, now it is supposed to work...
but no. The error message:
error: no ‘void Example::voidex ( )’ member function declared in class ‘example’.

What did I do wrong?
Voidex
voidex
Watch out for caps
I Think You Make The Capitals Wrong


Voidex




voidex
Topic archived. No new replies allowed.