User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 423,195 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,562 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser: Programming Forums

help me please I try to make a arithmetic calculator but i have 3 errors

Join Date: May 2006
Location: India
Posts: 247
Reputation: hammerhead is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 24
hammerhead's Avatar
hammerhead hammerhead is offline Offline
Posting Whiz in Training

Re: help me please I try to make a arithmetic calculator but i have 3 errors

  #3  
May 15th, 2008
You have declared variables x,y,z as members of the class and also as parameter values of the function arith_ex do something like this
  1. void Calculator::arith_ex(int x,int y,int z)
  2. {
  3. if(z==' ')
  4. {cout<<"ERROR: Operator-operand imbalance."<<endl;
  5. }
  6. cout<<"Sonuc="<<x/y+z<<endl;
  7. }
and call the function as
  1. hesap.arith_ex(5,4,3); //or any other values entered by the user

alternatively you can define the function without any arguments like
  1. void Calculator::arith_ex()
  2. {
  3. //rest of the code here
  4. }

in this line hesap.arith_ex(int x,int y ,int z); x,y,z are undefined. Declare them earlier in the code and assign them some values.
There are 10 types of people in the world, those who understand binary and those who don't.

All generalizations are wrong. Even this one.
Reply With Quote  
All times are GMT -4. The time now is 8:34 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC