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