c++ - Class variables and a function from header are ignored by some functions while compiling -
i have write class, errors don't make sense me. link codes , error message i'm getting.
i have declared private variables , functions in header file, variable can't seen functions , 1 of functions can't seen in .cpp.
precisely: int sizecounter can't seen void transportvalues() , void putvalue(), can seen void size(), void isempty() , void enqueue(). void swapvalues() gives "identifier not found" error though declared in header.
what i've tried , didn't work:
moving sizecounter or swapvalues private public.
moving functions can's see sizecounter or swapvalues private public.
asking experienced people help.
what i've tried , did work:
creating function prototype swapvalues in .cpp.
moving swapvalues above putvalue in .cpp(this worked if removed declaration header).
what haven't tried:
asking compile code show if error caused compiler.
i'm using visual studio 2008, btw. os: win 7(x64).
if find other mistakes in code not related ones consider no need correct me on those.
thanks in advance.
for out-of-class definition, should add class name before identifier, use
void heappriorityqueue::putvalue(string value, string* arr) rather than
void putvalue(string value, string* arr)
Comments
Post a Comment