C_C++/C_라이브러리_함수

(C언어) strcat: 문자열을 추가한다

고니자니 2023. 2. 28. 12:30
반응형
#include <string.h>
char *strcat(char *dest, const char *src);

strcat 함수는 문자열 src를 문자열 dest 뒷부분에 추가합니다. dest는 src를 추가할 공간이 있어야 합니다.

연결된 문자열의 포인터를 반환합니다.

 

참고: strncat

 

#define _CRT_SECURE_NO_WARNINGS  // Visual Studio
#include <stdio.h>
#include <string.h>
int main()
{
	char s[100] = "Hi";
	
	strcat(s, ", C Language.");
	printf("%s\n", s);

	return 0;
}

strcat: 문자열 추가

 

 

728x90
반응형