strstrプロジェクト

strstr.c

#include <stdio.h>
#include <string.h>
 
int main(void){
 
  char buf[256];
  char *find_str_ptr;
 
  find_str_ptr = NULL;
 
  printf("Input search string: ");
  scanf("%s", buf);
 
  if ((find_str_ptr = strstr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", buf)) == NULL){
    printf("%s is not found.\n", buf);
  }
  else{
    printf("%s is found: %s\n", buf, find_str_ptr);
  }
 
  return 0;
 
} 
 

タグ:

+ タグ編集
  • タグ:

このサイトはreCAPTCHAによって保護されており、Googleの プライバシーポリシー利用規約 が適用されます。

最終更新:2010年07月08日 15:20