Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/04/2013, 08:50
r_moccabostero
 
Fecha de Ingreso: abril-2009
Mensajes: 25
Antigüedad: 15 años
Puntos: 0
Por que esto no anda?

#include <stdio.h>

void strcopy(char *s, char *t);

int main(int argc, char **argv)
{
char *destino;
strcopy(destino, "Rodrigo");
printf("%s", destino);
return 0;
}

void strcopy(char *s, char *t)
{
int i = 0;

while ((s[i] = t[i]) != '\0')
{
i++;
}
}

Es una simple funcion que imita el strcpy.
Pero me da Segmentation Fault.
Por que?