/*----------------------------------------------------------------------------------------------------*/
#include <stdio.h> // Standard IO.
#include <conio.h> // Console. include getch().
/*----------------------------------------------------------------------------------------------------*/
void String_Copy(char *cp_src, char *cp_tgt)
{
while(*cp_src != 0)
{
*cp_tgt = *cp_src;
cp_tgt++;
cp_src++;
}
}
/*----------------------------------------------------------------------------------------------------*/
void main(void)
{
/****************************************************/
char c_src_str[11] = "GavinChang";
char c_tgt_str[11] = { 0 };
/****************************************************/
printf("Hello world !\n"); // Print a string.
/****************************************************/
printf("The source string :%s\n", c_src_str);
printf("The target string :%s\n", c_tgt_str);
String_Copy(c_src_str, c_tgt_str);
printf("The source string :%s\n", c_src_str);
printf("The target string :%s\n", c_tgt_str);
/****************************************************/
getch(); // Hold on the console window.
/****************************************************/
}
/*----------------------------------------------------------------------------------------------------*/