This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Which header should I include for "reverse"
- From: "learning c++" <learning_c at hotmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 30 Aug 2004 12:43:35 +0300
- Subject: Which header should I include for "reverse"
- Bcc:
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