Hi,
I am using copy_n from GNU C++ Library under Ubuntu 8.10. My code is like this:
#include <ext/algorithm>
using namespace std;
void myfun(char * flags ) {
char * flags_new = new char[3];
copy_n(flags, 3, flags_new);// both copy_n and copy would give not in this scope error.
delete [] flags_new;
}
int main()
{
char flags[3]={'a','b','c'};
myfun(flags );
return 0;
}
I got error : "‘copy_n’ was not declared in this scope".
I look up for copy_n in GNU C++ standard library document and find "ext/algorithm" to include. I was wondring what is the problem and how to fix it? Thanks!