STRCHR.C
Upload User: qq5388545
Upload Date: 2022-07-04
Package Size: 29849k
Code Size: 0k
Category:

GUI Develop

Development Platform:

C/C++

  1. #include <stdio.h>
  2. #include <string.h>
  3. void main(void)
  4.  {
  5.    char title[64] = "1001 C/C++ Tips!";
  6.    char *ptr;
  7.    if (ptr = strchr(title, 'C'))
  8.      printf("First occurrence of C is at offset %dn",
  9.        ptr - title);
  10.    else
  11.      printf("Character not foundn");
  12.  }