| 
 File: Stare vježbe/vjezbe09/58__strcpy.c 
/*     58__strcpy.c     Primjeri implementacije funkcije strcpy.     -----     Prototip: void strcpy(char *s, char *t);     Funkcija strcpy kopira kompletni sadrzaj stringa t (ukljucujuci i     posljednji '\0' karakter) na adresu gdje se nalazi string s. */   #include <stdio.h>   #define MAX 50   void strcpy1(char *s, char *t) {     int i=0;     while((s[i]=t[i])!='\0')         i++; }   void strcpy2(char *s, char *t) {     while((*s=*t)!='\0')         s++, t++; }   void strcpy3(char *s, char *t) {     while((*s++=*t++)!='\0'); }   void strcpy4(char *s, char *t) {     while(*s++=*t++); }   int main() {     char s1[MAX], s2[MAX];       gets(s1);       strcpy1(s2, s1);     printf("strcpy1(s2, s1) -> s2: %s\n", s2 );      strcpy2(s2, s1);     printf("strcpy1(s2, s1) -> s2: %s\n", s2 );      strcpy3(s2, s1);     printf("strcpy1(s2, s1) -> s2: %s\n", s2 );      strcpy4(s2, s1);     printf("strcpy1(s2, s1) -> s2: %s\n", s2 );        return 0; }   
 
          
  
       |