strchr: returns a pointer to the first occurrence of ch in *str or a null pointer if not found : strchr « string.h « C / ANSI-C






strchr: returns a pointer to the first occurrence of ch in *str or a null pointer if not found


    


//Declaration:  char *strchr(const char *str, int ch); 
//Return:       returns a pointer to the first occurrence of ch in *str or a null pointer if not found. 

    
  

  #include <stdio.h>
  #include <string.h>
  int main(void)
  {
    char *p;

    p = strchr("this is a test", ' ');
    printf(p);

    return 0;
  }

         
/*
 is a test*/ 
           
       








Related examples in the same category