yo02 de Febrero del 2006
Preguntaalguien me puede decir que hace cada comando de este programa?gracias.
#include <stdio.h>
#include <conio.h>
main()
{
char texto1[50],texto2[25];
char*encadena (char*texto1,char*texto2);
printf ("introduce un texto\n");
gets (texto1);
printf ("introduce un texto\n");
gets (texto2);
encadena(texto1,texto2);
puts (texto1);
while(!kbhit());
}
char*encadena (char*texto1,char*texto2)
{
int i,j;
i=0;
while (texto1[i]!=\'\0\')
i++;
for (j=0;texto2[j]!=\'\0\';j++)
{
texto1[i]=texto2[j];
i++;
}
texto1[i]=\'\0\';
return texto1;
}
#include <stdio.h>
#include <conio.h>
main()
{
char texto1[50],texto2[25];
char*encadena (char*texto1,char*texto2);
printf ("introduce un texto\n");
gets (texto1);
printf ("introduce un texto\n");
gets (texto2);
encadena(texto1,texto2);
puts (texto1);
while(!kbhit());
}
char*encadena (char*texto1,char*texto2)
{
int i,j;
i=0;
while (texto1[i]!=\'\0\')
i++;
for (j=0;texto2[j]!=\'\0\';j++)
{
texto1[i]=texto2[j];
i++;
}
texto1[i]=\'\0\';
return texto1;
}
