cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Very quick question
Very quick question
Apr 5, 2012 at 1:21pm UTC
shaggy
(66)
hello, when i create a new class ( for my player or enemy or bullet etc.) do i need to have it in its own header file? i already do, but could i just have the class definition above the main(). ? thankyou
Apr 5, 2012 at 1:24pm UTC
SIK
(309)
you may do this, but your code becomes less modular, ie you would then not be able to share this class with other projects as easily.
Apr 5, 2012 at 1:27pm UTC
shaggy
(66)
ahh i see thankyou. so it is best to put it in its own header so i can re use that code and header in its own type
Topic archived. No new replies allowed.