what am i doing wrong? classes

Hi guys I have a problem with declaring functions inside my hoj.cpp file I have not programmed in a while but I thought I was doing this right but turns out I'm not can anybody help me with this error,Thanks


Hoj.cpp
1
2
3
4
5
6
7
8
9
10
  using namespace std;

hoj::hoj()
{

}

void hoj::saySomething(){

}


hoj.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#ifndef HOJ_H
#define HOJ_H
using namespace std;

class hoj
{
    public:
        hoj();
        saySomething();

    protected:

    private:
};

#endif // HOJ_H

closed account (E0p9LyTq)
Your class method, saySomething(), is missing the return type in the class declaration (hoj.h).

You are not including your header file in your class definition (hoj.cpp).
thanks,I forgot you need to put the return type in the .h file which i find bit stupid
Topic archived. No new replies allowed.