can we define a class in one c++ source file and main function in another c++ source file in the same folder and then implement that class.
can we define a class in one c++ source file and main function in another c++ source file in the same folder and then implement that class.
Oops. This is *C* forum.
Usually you define a class in a header file and implement it in a .cpp file.
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008
"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.