
04/02/2004, 23:42
|
| | Fecha de Ingreso: febrero-2004 Ubicación: Habana
Mensajes: 6
Antigüedad: 21 años, 1 mes Puntos: 0 | |
//---------------------------------------------------------------------------
#include<iostream>
using namespace std;
int main(int argc, char* argv[])
{
char * cadena="hardys-perez";
static char destino1[10];
static char destino2[10];
char* temp = {NULL};
for(int i =0;i<strlen(cadena);++i)
if(cadena[i] == '-')
{
temp = &(cadena[i]);
++temp;
strncpy(destino1, cadena, i);
strcpy (destino2, temp);
}
cout<<destino1<<" "<<destino2;
system("pause");
return 0;
}
//--------------------------------------------------------------------------- |