Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[C++] Moving classes to header files
#10
Lucida Wrote:The way I was told was to put the class declaration into the header file and the method definitions into the corresponding C++ file.

However (excuse my hijacking), would there be any problem with combining the two and putting it in a single header file, without a corresponding C++ file? I've always done that to be lazy and I wonder if there's actually any downside to it.

This is how I learned to do it as well. I believe this is how most people are taught in the classroom and if you learn on your own, this is generally what you see in most cases.

I've never thought about putting it all in one, though.
I think I like the standard way of doing it. Seems more organized. Smile

.02c.
Reply


Messages In This Thread
[C++] Moving classes to header files - by Dusk - 2010-05-07, 09:34 PM
[C++] Moving classes to header files - by Eos - 2010-05-07, 09:41 PM
[C++] Moving classes to header files - by Eos - 2010-05-08, 12:40 AM
[C++] Moving classes to header files - by Russt - 2010-05-09, 12:18 AM
[C++] Moving classes to header files - by Eos - 2010-05-09, 12:25 AM
[C++] Moving classes to header files - by Spaz - 2010-05-09, 01:08 AM
[C++] Moving classes to header files - by Eos - 2010-05-09, 01:13 AM
[C++] Moving classes to header files - by xLeviathan - 2010-05-09, 08:37 AM
[C++] Moving classes to header files - by Russt - 2010-05-20, 09:55 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)