char *strcpy(char *strDestination, const char *strSource);
Parameter:
strDestination: chuỗi kí tự đích
strSource: chuỗi kí tự nguồn
Remark:
Hàm strcpy( ) copy nội dung của strSource( gồm cả kí tự NULL ở cuối) sang strDestination.
- Hàm strcpy( ) trả về con trỏ char* trỏ tới chuỗi kí tự đích
Ví dụ:
#include "stdio.h" #include "conio.h" #include "string.h" void main( void ) { char string[50]; strcpy( string, "This is vncoding forum" ); printf( "String = %s\n", string ); getch(); }
Kết quả:
Leave a Reply
You must be logged in to post a comment.