strcmpプロジェクト

strcmp.c

#include <stdio.h>
#include <string.h>
 
int main(void){
 
  char buf[256];
 
  printf("Input string: ");
  scanf("%s", buf);
 
  if (strcmp(buf, "hoge") == 0){
    printf("buf == hoge\n");
    printf("buf: %s\n", buf);
  }
  else{
    printf("buf != hoge\n");
    printf("buf: %s\n", buf);
  }
 
  return 0;
 
}
 

タグ:

+ タグ編集
  • タグ:

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

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