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

Popular posts from this blog

jQuery Ajax Render Fragments OR Whole Page -

javascript - Iterate over array and calculate average values of array-parts -

java - Simple Command Line calculator -