This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Which header should I include for "reverse"


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]