开发者

Member function declared, but compiler says its not

This is my Position.h file:

#ifndef POSITION_H_
#define POSITION_H_

class Position{
    public:
    Position(int v);
    int pos();
    private:
    int value;
    bool win;

};

#endif

This is my Position.cpp file:

#include "Position.h"

Position::Position(int v):value(v){
}

int Position::pos(){
    return value;
}

My error is:

Position.cpp:8: error: no 'int Position::pos()' member function declared in class 'Position'

I've been trying to fix this for hours and the function is declared. I don't 开发者_JS百科understand why this wont compile.


Its compiling for me... you must be doing something weird.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜