본문 바로가기
dev/C

[C] function - strrchr()

by seohan1010 2024. 5. 29.

STRing(find from the right) CHaRacter

 

 

https://pythontutor.com/visualize.html#mode=edit

 

Python Tutor code visualizer: Visualize code in Python, JavaScript, C, C++, and Java

Please wait ... your code is running (up to 10 seconds) Write code in Python 3.11 [newest version, latest features not tested yet] Python 3.6 [reliable stable version, select 3.11 for newest] Java C (C17 + GNU extensions) C++ (C++20 + GNU extensions) JavaS

pythontutor.com

 

 

 

 

#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>




int main()
{

  char str1[30] = "this is for test";

  char *ptr = strrchr(str1,'e');

  printf("%s\n",ptr);


    return 0;

}




'dev > C' 카테고리의 다른 글

[C] 16진수를 문자열로 출력하기  (0) 2024.05.29
[C] function - atoi  (0) 2024.05.29
[C] function - strtok()  (0) 2024.05.29
[C] string - 4  (0) 2024.05.28
[C] string - 3  (0) 2024.05.27