Which header should I include for "reverse"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux