057. 문자열 복사하기(strcpy)057. 문자열 복사하기(strcpy)

Posted at 2011. 1. 30. 17:47 | Posted in Computer/초보자를 위한 C 언어 300제
#include <stdio.h>
#include <string.h>

#define KOREA "대한민국"

void main( void )
{
	char *string1;
	char string2[100];

	strcpy( string1, KOREA );		// 실행 시 에러 발생
	strcpy( string2, KOREA );
	strcpy( string2, "봄" );
}
//