Strcpy_s

     
*
Include dependency graph for strcpy_s.c:


Bạn đang xem: Strcpy_s

*

Functions

EXPORT errno_t strcpy_s (char *restrict dest, rsize_t dmax, const char *restrict src)
 The strcpy_s function copies the string pointed khổng lồ by src (including the terminating null character) into the array pointed khổng lồ by dest. More...
 

Function Documentation

◆strcpy_s()




Xem thêm: Hướng Dẫn Cách Xóa Tài Khoản Instagram Phụ Trên Điện Thoại Đơn Giản Nhất

EXPORT errno_t strcpy_s ( char *restrict  dest,
rsize_t  dmax,
const char *restrict  src 
)



Xem thêm: Bí Mật Cách Làm Lạp Xưởng Không Cần Rượu Mai Quế Lộ, Bí Mật Cách Làm Lạp Xưởng Không Cần Phơi Nắng

The strcpy_s function copies the string pointed khổng lồ by src (including the terminating null character) into the array pointed to by dest.

With SAFECLIB_STR_NULL_SLACK defined all elements following the terminating null character (if any) written by strcpy_s in the array of dmax characters pointed khổng lồ by dest are nulled when strcpy_s returns.

RemarksSPECIFIED INISO/IEC TR 24731, Programming languages, environments & system software interfaces, Extensions to lớn the C Library, Part I: Bounds-checking interfacesParameters
destpointer to lớn string that will be replaced by src.
dmaxrestricted maximum length of dest
srcpointer to lớn the string that will be copied lớn dest
PreconditionNeither dest nor src shall be a null pointer. Dmax shall not be greater than RSIZE_MAX_STR. Dmax shall not equal zero. Dmax shall be greater than strnlen_s(src, dmax). Copying shall not take place between objects that overlap.NoteC11 uses RSIZE_MAX, not RSIZE_MAX_STR.ReturnsIf there is a runtime-constraint violation, then if dest is not a null pointer và destmax is greater than zero & not greater than RSIZE_MAX_STR, then strcpy_s nulls dest. Return values
EOKwhen successful operation, the characters in src were copied into dest & the result is null terminated.
ESNULLPwhen dest or src is a NULL pointer
ESZEROLwhen dmax = 0
ESLEMAXwhen dmax > RSIZE_MAX_STR
ESOVRLPwhen strings overlap
ESNOSPCwhen dest See alsostrcat_s(), strncat_s(), strncpy_s()
kimsa88
cf68