I have a good understanding of c++.
Just I have always been using class in main.cpp not in separated file.And my question is how to draw everything in there.
You had never the need to use multiple files with C++ and don't understand how to separate declarations and definitions, than I know, that your knowledge is lacking on some important features of C++. It's not bad or anything, but it's also not helpful not wanting to read it up in a C++ book that actually explains it.
It's rather simple: Declarations belong into the header file (in C++ preferably with the ending .hpp), while the definitions belong into the source file (.cpp). Every file that wants to use the class/functions needs to include the header file, even the source file that holds the definitions. To prevent multiple inclusions and thus multiple declarations of a class/function one should
always add include guards to the header file. The way to do this, that is supported by the C++ standard, is to use
#ifndef #define #endif pre-processor commands.
Any good C++ book would cover that.