hrishi321 wrote: but it shows linking errors
That has nothing to do with whether your source is in a
.cpp file. Link errors occur when you have references to objects or methods which do not exist within your program.
hrishi321 wrote:FOR SOME REASON , I DON'T WANT TO PUT THE METHOD'S DEFINITIONS IN .h FILE
1. Please do not SHOUT, we can read in normal case perfectly well.
2. You can put your definitions anywhere you like. The only requirement is that the compiler can find them when it comes across a reference in the source code. For example a statement of the form:
CThing thing = new CThing();
requires a definition of
CThing, and that definition must already exist in the compiler's dictionary, having been found either in an included
.h file, or previously in the current source
The best things in life are not things.