C Board  

Go Back   C Board > General Programming Boards > C++ Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 04-21-2008, 06:45 AM   #1
MMu
Registered User
 
Join Date: Mar 2008
Posts: 4
Question Overloading << and >>

Please tell me why my input and output are not the same in this code.
cents is always zero and the symbol is not defined!
Attached Files
File Type: cpp last_op_ques.cpp (816 Bytes, 41 views)
MMu is offline   Reply With Quote
Old 04-21-2008, 06:49 AM   #2
Cat without Hat
 
CornedBee's Avatar
 
Join Date: Apr 2003
Posts: 8,439
It can't parse the separating dot. You need to read it into a dummy char.

By the way, you're using the pre-standard headers. See the FAQ for why you should use <iostream> instead of <iostream.h>, and what else you need to change as a consequence.
__________________
All the buzzt!
CornedBee

"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law
CornedBee is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Overloading fstream's << and >> operators Bubba C++ Programming 2 04-09-2007 03:17 AM
Overloading << and >> Enahs C++ Programming 2 09-15-2005 04:33 PM
<< and >> overloading Armatura C++ Programming 2 12-07-2003 06:19 PM
Overloading the << and >> operators WebmasterMattD C++ Programming 9 10-15-2002 05:22 PM
istream >> overloading wazza13 C++ Programming 1 05-03-2002 10:56 PM


All times are GMT -6. The time now is 07:23 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22