Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialwonderyak
11,167 PointsAside from scope, is there any reason that I'd _not_ want to declare the enum within the struct?
My solution to the exam/challenge had the enum Status
within the struct Task
.
Other than losing access to Status
due to scope, is there any reason I would not want to declare the enum within the struct? Or, is it irrelevant and just a different way to solve the quiz?
1 Answer
Soojin Ro
13,331 PointsLosing access to scope is pretty much the whole reason. I think there is no point of declaring enum if no one can use! Of course there might be rare cases where you only need enum within struct but very unlikely.
wonderyak
11,167 Pointswonderyak
11,167 PointsThanks! I figured that was the case but I wasn't sure if there was any other impact to performance or something like that.