C 언어

copy

SpeeDr00t 2016. 7. 9. 01:33
반응형

#include<stdio.h>

void copy(char *to, char *from)


[CF-1-4] copy
 
/*
    author : kyoung chip jang
    date : 
    descript:     
    
*/

int main( int argc , char ** argv )
{
    char str1[10];
    char *str2 = "1234";
    copy( str1, str2 );
    printf(" str1 = %s \n", str1 );  
 
return 0; 
}

void copy(char *to, char *from)
{
    int i = 0;   
    while ((to[i] = from[i]) != '\0')
        ++i;
}

반응형