G++ - Update
Dieter Vrancken
yellowdog-general@lists.terrasoftsolutions.com
Thu, 16 Sep 2004 07:08:47 +0200
apply a little patch to your code:
7c7
< std::int input;
---
> int input;
10c10
< cin > input;
---
> cin >> input;
Correct me if I'm wrong, but didn't the compiler tell you this already?
- Dieter
> Subject: Re: G++ - Update
> From: Derick Centeno <aguilarojo@verizon.net>
> To: YDL Gen <yellowdog-general@lists.terrasoftsolutions.com>
> Date: 15 Sep 2004 16:28:58 -0400
> Reply-To: yellowdog-general@lists.terrasoftsolutions.com
>
> [...]
>
> 1 //#include <iostream.h>
> 2 //#include<istream>
> 3 #include <iostream>
> 4 using namespace std;
> 5
> 6 int main(void) {
> 7 std::int input;
> 8
> 9 cout << "Enter a number: ";
> 10 cin > input;
> 11 cout << "Twice the number you supplied is " << 2 *
> input << endl;
> 12 return 0;
> 13 }
>
> System's response was:
>
> [root@arakus aguilarojo]# g++ -Wall -o numbertest numbertest.C
> numbertest.C: In function `int main()':
> numbertest.C:7: parse error before `int'
> numbertest.C:10: `input' undeclared (first use this function)
> numbertest.C:10: (Each undeclared identifier is reported only once for
> each function it appears in.)