c++ beginner 的菜鸟问题请问将program分在三个function的问题:
即: lab.cpp data.h data.cpp
为什么我用"inline"在data.cpp(implementation file)里的某些class member function 的前面,compile时就会出错呢?
但是去掉"inline"后就什么问题都没有了,program运行也很正常.
难道分成3个file就不能用"inline" function?
如果能用,用法还是和写在一个file里一样吗?
注:我所用到的inline function都是很小的class member function:
eg:
class Datalist {
..............
int getMonth() const;
..............
}
inline int Datelist::getMonth() const {
return month;
}
i even got problem when i try to compile
normal .h file.
the code is posted.
can help me? thanks
the code is posted.
can help me? thanks