Ok I use the following function but i get strange errors..
I get the following errors/warning..
double term(bool get) // multiply and divide
double left = prim(get);
case POWER :
double y = prim(true); //error is here!
case MUL :
left *= prim(true);
case DIV :
if (double d = prim(true))
left /= d;
return error("Divide by 0");
/Users/luigi/Documents/c++/Bjarne/Project Builder/Ch 6/ex18*/calc.cpp:122: crosses initialization of `double y'
/Users/luigi/Documents/c++/Bjarne/Project Builder/Ch 6/ex18*/calc.cpp:125: warning: jump to case label
case Div is about the same but I dont get any errors... why is that so?
What is prim( ) defined as?
well here is the full code..
but dont use create() function its not working yet..
and im trying to fix power as asked in this post..
but dont worry nothing dangerous..
everything else should work perfectly..
Compiles with a completely different error for me:
g:\c++\luigicalc\calc.cpp(205) : error C2039: 'push_back' : is not a member of 'basic_string<char,struct std::char_traits<char>,class std::allocator<char> >'
But the part that's giving you trouble seems to be fine.
where do you get that error and with wich compiler?
Sorry, I forgot to mention that I'm using MSVC++ 6.
I finally decided to try it on code warrior 8.3 and i got no errors at all..
and now everything is going great...
I guess pb needs to be upgraded..