This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Which header should I include for "reverse"
- From: Arno Wilhelm <arno dot wilhelm at profile dot co dot at>
- To: learning c++ <learning_c at hotmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 30 Aug 2004 12:51:59 +0200
- Subject: Re: Which header should I include for "reverse"
- Organization: proFILE Computersysteme GmbH
- References: <BAY12-F17ZKZlZU6Vin000239ca@hotmail.com>
- Reply-to: arno dot wilhelm at profile dot co dot at
Have not tried it out but maybe "using namespace std;" or
"std::reverse" would help ?
regards,
Arno
On Mon, 2004-08-30 at 11:43, learning c++ wrote:
> Hi, Everyone:
>
> I compiled a short program to use "reverse" like this:
>
> #include <iostream>
> #include <algorithm>
>
> int main() {
>
> double A[6] = { 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 };
> reverse(A, A + 6);
> for (int i = 0; i < 6; ++i)
> std::cout << "A[" << i << "] = " << A[i];
> return 0;
> }
>
> But the error is:
> reverse.cpp: In function `int main()':
> reverse.cpp:7: error: `reverse' undeclared (first use this function)
> reverse.cpp:7: error: (Each undeclared identifier is reported only once for
> each function it appears in.)
>
> Thanks in advance!
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
--
Arno Wilhelm <arno.wilhelm@profile.co.at>
proFILE Computersysteme GmbH