Struct include from header file.

Hello.
I write two class myTime and myDate, I insert in myTime.cpp and myDate.cpp

1
2
3
4
5
6
7
struct tm returnTM(){
		time_t timeLocal = NULL;
		struct tm *tmS;
		time(&timeLocal);
		tmS = localtime(&timeLocal);
		return *tmS;
}


if i use in project all created class i have error "returTM already defined in myDate.obj"

I want to insert struct method in header file "sStrruct.h", but i have error the same, i delete definition in myTime and myDate.

What i must to do?
I create new class myDT, in there i copy method returnTM().

Class myDate and myTime inheritance after myDT, that work good ;)
Topic archived. No new replies allowed.