C/string.h/strstr


Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Creation of dynamic property PPDStack::$accum is deprecated in /var/www/cppe.ru/www/includes/parser/Preprocessor_DOM.php on line 803

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/includes/exception/MWExceptionHandler.php on line 179

Deprecated: Constant E_STRICT is deprecated in /var/www/cppe.ru/www/vendor/mediawiki/at-ease/src/Functions.php on line 48
Материал из C\C++ эксперт
Перейти к: навигация, поиск

strstr: Returns a pointer to the first occurrence of *str2 in *str1 or a null pointer if there str2 is not part of str1

    
//Declaration:  char *strstr(const char *str1, const char *str2); 
//Return:       It returns a null pointer if no match is found. 
  #include <string.h>
  #include <stdio.h>
  int main(void)
  {
    char *p;
    p = strstr("this is a test", "is");
    printf(p);
    return 0;
  }
         
/*
is is a test*/