when we define a class member function in header file of that class then inline keyword must be used. why?
问题 i defined a class in header file and implemented its function in same header file. but while defining these functions i have to put inline keyword with function definition. Otherwise compiler gave compile time error. I know inline is only a hint to compiler. So why it is necessary to put inline keyword with function definition. I am using visual studio compiler with qt for compiling the code here is the code tempinline.h #ifndef TEMPINLINE_H #define TEMPINLINE_H #include "iostream" class