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,627 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 3,286 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

class

Join Date: Jan 2007
Posts: 65
Reputation: mauro21pl is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
mauro21pl mauro21pl is offline Offline
Junior Poster in Training

Re: class

  #6  
Aug 7th, 2007
Actually one more question
I did that so far:

 
void Money::input (istream& ins)
{
  cout<<"\n\nYou are going to set up the amount for your_account"<<endl;
  cout<<"Enter the amount to your_account: ";
  bool negative;
  char first_character;
  char decimal_point;
  int first_number,second_number,all_cents;
  ins>>first_character;
    
    if (first_character=='-')
    negative=true;
    else negative=false;
    if(negative)
    {
    ins>>first_number>>decimal_point>>second_number;
    //cout<<first_number<<"."<<second_number;
    dollar_amount=-first_number;
    cent_amount=-second_number;
    }
    if(isdigit(first_character))
    {
    ins>>dollar_amount>>decimal_point>>cent_amount;
    //second_number=static_cast<int>(first_character);
    
    }
}

what i'm loosing right now is just the first digit of the positive number. How may I add that lost number which is a character to the dollar_amount so it will hold an whole number.
thanks
Reply With Quote  
All times are GMT -4. The time now is 9:33 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC