B
Blackjack2000
Compiling in Microsoft Visual C++ 6.0...
It has to use a dynamic ADT Stack
I wrote the ADT stack (something I'm not really good at yet) but I have not been able to figure out this error. It occurs when I make the function call:
answer = testStack.postFix(expression);
postFix is a member function that takes a string as a value parameter and returns an int. This is the error I get:
Compile Error
error C2440: '=' : cannot convert from 'int (__thiscall Stack::*)(int [])' to 'int'
Conversion is a valid standard conversion, which can be performed implicitly or by use of static_cast, C-style cast or function-style cast
It looks like I'm trying to return data of the wrong type, but I went over the code, and I everything seemed to be right. I think it's probably some nuance of the ADT that I haven't figured out yet and will take a few more hours. The asterisk in the error statment makes me think it's a problem with pointers, in which case I have nothing but headaches to look forward to...
I'm too tired to try anything else tonight, but would it work if I changed it to a void function and used a reference parameter? Any help would be appreciated.
It has to use a dynamic ADT Stack
I wrote the ADT stack (something I'm not really good at yet) but I have not been able to figure out this error. It occurs when I make the function call:
answer = testStack.postFix(expression);
postFix is a member function that takes a string as a value parameter and returns an int. This is the error I get:
Compile Error
error C2440: '=' : cannot convert from 'int (__thiscall Stack::*)(int [])' to 'int'
Conversion is a valid standard conversion, which can be performed implicitly or by use of static_cast, C-style cast or function-style cast
It looks like I'm trying to return data of the wrong type, but I went over the code, and I everything seemed to be right. I think it's probably some nuance of the ADT that I haven't figured out yet and will take a few more hours. The asterisk in the error statment makes me think it's a problem with pointers, in which case I have nothing but headaches to look forward to...
I'm too tired to try anything else tonight, but would it work if I changed it to a void function and used a reference parameter? Any help would be appreciated.