strcpy

Giannis Papaioannou jhn at egnatia.ee.auth.gr
Wed Apr 26 11:35:13 EEST 2000


Mias kai polloi eipan gia malloc

On Tue, 25 Apr 2000, L.O.V.E. wrote:
> #include <stdlib.h>
...
>  char *dest2, *dest3;

edw mallon einai *test2 *test3

> printf("\n source: %s", source);
...
> printf("\n dest2: %s\n", dest2);
>
> strcpy(dest3, source);

xmm... h' den katalabes kala ti einai pointer kai giati xreiazete
h malloc h' ennouses dest3=source;

...
> }
> output:
> ------------
> source : the source string
> dest1:  the source string
> dest2 :  the source string

den yparxei printf("\n dest3: %s\n",dest3); alla kai na yphrxe
den 8a prolabene na typo8ei kai 8a katalabaines oti den typonei
kanonika to output

> Segmatation fault(core dumped)


--
linux-greek-users mailing list -- http://lists.hellug.gr




More information about the Linux-greek-users mailing list