Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 |
Tags
- fprintf
- 속도저하
- 소캣
- interrupt context
- usb2.0
- Shared Folder
- memcmp
- context switch
- DMA
- layouts
- context
- 멀티프로세싱
- fscanf
- interrupt handler
- 젠킨스
- sscanf
- gparted
- activities
- 문자형 디바이스 파일
- sprintf
- ubuntu
- makefile
- 환경 변수
- HDR
- 디스크 축소
- intents
- 디스크립터
- pagefile.sys
- jenkins
- 프레임버퍼
Archives
- Today
- Total
do{학습}while
c) strstr() 본문
기능 요약
str1에 str2 문자열이 존재하는지 찾는 함수
헤더파일
#include <string.h> // C++ 에서는 <cstring>
원형
const char* strstr(const char* str1, const char* str2);
char* strstr(char* str1, const char* str2);
반환값
str1 문자열에서 str2 문자열을 검색하고 만약 일치하는 문자열이 존재한다면 해당 문자열이 위치한 str1의 주소값을 반환합니다.
일치하는 문자열이 없다면 NULL을 반환합니다.
주의 사항
예시 코드
#include <stdio.h>
#include <string.h>
int main() {
char str[] = "This is a simple string";
char* pch;
pch = strstr(str, "simple");
strncpy(pch, "sample", 6);
puts(str);
return 0;
}'C & C++ > c언어 표준함수' 카테고리의 다른 글
| c) realloc() (0) | 2024.05.28 |
|---|---|
| c) strcat() (0) | 2024.05.28 |
| c) getchar() (0) | 2024.05.28 |
| c) puts() (0) | 2024.05.28 |
| c) fgets() (0) | 2024.05.28 |