#include <stdio.h>
#include <string.h>
#include <malloc.h>

//
// Created by 王东梁 on 2023/9/17.
//
int main() {
//    //截取第一个l和其之后的一个字符串
//    char s[]="hello";
//    char *p=strchr(s,'l');//表示在字符串中寻找单个字符VS字符串中找字符串char* strstr(const char*s1,const char* s2);

    p=strchr(p+1,'l');
//    char *t=(char*)malloc(strlen(p)+1);
//    strcpy(t,p);
    printf("%s\n",p);
//    printf("%s\n",t);
//    free(t);


    //截取第一个l之前的字符串
    char s[]="hello";
    char *p=strchr(s,'l');
    char c=*p;
    *p='\0';
    printf("%s\n",s);
    return 0;
}