objects + [copy]constructors + etc
Disclaimer: the following post is a ramble. Please feel free to comment on whatever part of it you wish ;)
I noticed that if I assign an enumeration variable to a fundamental type variable, it's disallowed:
Code:
enum test{one} yo=one; int a=5; yo=a; //error
however, if I pass an enumeration variable to a function which takes, say, an int, the type conversion is allowed and takes place. How and why does that work?
Is that related to the case where you have a class, called for example test, and you initialize it like: test ob=5; ? Is that calling the copy constructor and converting int to type test? Is that calling the copy constructor at all? How is it different from test ob(5); ?
thanks a bunch