LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Need Help On Enums (https://www.linuxquestions.org/questions/programming-9/need-help-on-enums-607779/)

rohithzhere 12-19-2007 12:29 AM

Need Help On Enums
 
Hi all,

I m a newbie to programming. I was working on Enums in C++. I was not able to copy enum of one class to enum of another class. please help me on this issue.

Hko 12-19-2007 02:19 AM

We cannot see such a problem without seeing it. Please post code you have so far.

paulsm4 12-19-2007 12:48 PM

Hi -

In C++, every different enum you define is literally a different "type". So it makes sense that you wouldn't be able to copy directly from one "type" (one enum in one class) to another (a different enum in a different class) without casting. This is somewhat different from "C" enums (which lets you more or less freely interchange different enums).

Here is some more information on the subject:

http://en.wikipedia.org/wiki/Enumerated_type

'Hope that helps .. PSM

PS:
If my hunch about your real question is incorrect, or if you have further questions, please follow HKo's advice and post sample code illustrating the problem. It definitely helps ;-)


All times are GMT -5. The time now is 10:33 AM.