eclipse - C++ pass enum to object constructor -
say have following:
foo::foo() { value = 25; //default constructor... } foo::foo(enum bar) { value = (int)bar; //purpose allow integer take enum constant's integer value. }
from...
enum enum { = 25, b = 50, } class foo { public: foo(); foo(enum bar); private: int value; }
yet, if following:
enum bar = a; //a = 25 foo * foo = new foo(a); //error: "undefined reference foo::foo(enum)"
this in eclipse cdt 3.6. why happening? there can solve problem?
it sounds forgot link foo.c
final application.
Comments
Post a Comment