Unbelievably Silly
From: R.N. Smith (mia01_at_keele.ac.uk)
Date: 10/31/03
- Next message: Martijn Lievaart: "Re: Unbelievably Silly"
- Previous message: _at_k6a7n8a9r.net without the numbers: "Re: C++ and input, it can't be platform specific"
- Next in thread: Martijn Lievaart: "Re: Unbelievably Silly"
- Reply: Martijn Lievaart: "Re: Unbelievably Silly"
- Reply: Aggro: "Re: Unbelievably Silly"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 31 Oct 2003 15:11:16 -0000
The following program, compiled with the GNU C++ compiler (actually g++)
fails to work.
Enter an integer and waits until a letter has been typed in. It then outputs
only the first digit of the integer read.
e.g. if we enter
1234 <return>
c<return>
the prog responds :-
number is 1
How can anything this simple go wrong ?
Rob
#include <iostream.h>
using namespace std;
int main()
{
int i;
cin>>i;
cout << "number is " << i <<endl;
return(0);
}
- Next message: Martijn Lievaart: "Re: Unbelievably Silly"
- Previous message: _at_k6a7n8a9r.net without the numbers: "Re: C++ and input, it can't be platform specific"
- Next in thread: Martijn Lievaart: "Re: Unbelievably Silly"
- Reply: Martijn Lievaart: "Re: Unbelievably Silly"
- Reply: Aggro: "Re: Unbelievably Silly"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|