Please Help Class problem!

Here's the code :
#include <iostream>
#include <cmath>
#include <string>
using namespace std;

class Register
{
public:
void Registering()
{
cout<<"crap"<<endl;
}
};

int main()
{
Register rkey;
Register.Registering();
}
and here's the log:
C:\Users\User\Desktop\C++\GOD DAMMIT\main.cpp: In function 'int main()':
C:\Users\User\Desktop\C++\GOD DAMMIT\main.cpp:18:13: error: expected unqualified-id before '.' token
C:\Users\User\Desktop\C++\GOD DAMMIT\main.cpp:17:14: warning: unused variable 'rkey' [-Wunused-variable]
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 1 warning(s) (0 minute(s), 0 second(s))
1
2
Register rkey;
Register.Registering();

Registering is not a static method so you can't call it like this.

I guess what you want to do is rkey.Registering();
Topic archived. No new replies allowed.