zoukankan      html  css  js  c++  java
  • C strstr() 函数

    包含文件:string.h
    函数名: strstr
    函数原型:extern char *strstr(const char *str1, const char *str2);
    语法:* strstr(str1,str2)
    str1: 被查找目标 string expression to search.
    str2: 要查找对象 The string expression to find.
    返回值:该函数返回str2第一次在str1中的位置,如果没有找到,返回NULL
    The strstr() function returns the ordinal position within str1 of the first occurrence of str2. If str2 is not found in str1, strstr() returns 0.
     
    例子:
    charstr[]="1234xyz";
    char*str1=strstr(str,"34");
    cout<<str1<<endl;
    

    显示: 34 xyz

    具体可以参考:http://baike.baidu.com/view/745156.htm?fr=aladdin#2

  • 相关阅读:
    MongoDB 与 MySQL 性能比较
    PySpider简易教程
    使用redis有什么缺点
    禅道
    Shell02
    Shell01
    性能测试06
    性能测试05
    性能测试04
    性能测试03
  • 原文地址:https://www.cnblogs.com/lanye/p/3736303.html
Copyright © 2011-2022 走看看