Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to define enums

Tags:

c++

Say I want to create a card class. and want to have enums for the cards

2,3,4,5,6,7,8,9,J,Q,K,A

Where's the best place to define this, the header file Card.h or Card.cpp?

like image 256
user1066113 Avatar asked Dec 27 '11 23:12

user1066113


1 Answers

It's going to be a new type. So I would probably put it on the header file in case I need it in other compilation units.

like image 177
Pablo Santa Cruz Avatar answered Oct 26 '22 23:10

Pablo Santa Cruz