Delphi - funcion copy

 
Vista:

funcion copy

Publicado por WS (3 intervenciones) el 21/07/2008 17:55:20
Saludos,
tengo un problema con borland builder c++ (se que no es donde debo colocar el post, pero no ahy una carpeta para este y delphi es lo que mas se asemeja).
Resulta que no encuentra la funcion copy, me marca call to undefined function.
Alguien me podria decir que libreria necesito incluir?
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil

RE:funcion copy

Publicado por m@slfire (14 intervenciones) el 23/07/2008 02:39:39
Esa funcion se encuentra definida en el archivo de cabecera "algorithm.h"

#include <algorithm>

Example

//
// stdlib/examples/manual/copyex.cpp
//
#include <algorithm>
#include <vector>
#include <iostream>
using namespace std;
int main()
{
int d1[4] = {1,2,3,4};
int d2[4] = {5,6,7,8};
// Set up three vectors
//
vector<int> v1(d1,d1 + 4), v2(d2,d2 + 4), v3(d2,d2 + 4);
//
// Set up one empty vector
//
vector<int> v4;
//
// Copy v1 to v2
//
copy(v1.begin(),v1.end(),v2.begin());
//
// Copy backwards v1 to v3

//
copy_backward(v1.begin(),v1.end(),v3.end());
//
// Use insert iterator to copy into empty vector
//
copy(v1.begin(),v1.end(),back_inserter(v4));
//
// Copy all four to cout
//
ostream_iterator<int,char> out(cout," ");
copy(v1.begin(),v1.end(),out);
cout << endl;
copy(v2.begin(),v2.end(),out);
cout << endl;
copy(v3.begin(),v3.end(),out);
cout << endl;
copy(v4.begin(),v4.end(),out);
cout << endl;


return 0;
}

Program Output

1 2 3 4
1 2 3 4
1 2 3 4
1 2 3 4
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar