teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

ソースコードを見やすくしました

2017/05/14 06:09

投稿

isc.2017
isc.2017

スコア12

title CHANGED
File without changes
body CHANGED
@@ -5,14 +5,14 @@
5
5
  2,事前に登録された情報の中から部分一致検索する
6
6
  3,部分一致検索で該当した人のメールアドレス、氏名、グループの番号、IDを該当した人数分表示する
7
7
  というものです。
8
+ ```
9
+ #include <stdio.h>
10
+ #include <stdlib.h>
11
+ #include <string.h>
8
12
 
13
+ #define BUFSIZE 128
9
- .#include <stdio.h>
14
+ #define DATASIZE 1000
10
- .#include <stdlib.h>
11
- .#include <string.h>
12
15
 
13
- .#define BUFSIZE 128
14
- .#define DATASIZE 1000
15
-
16
16
  struct data {
17
17
  char mail[256]; //メールアドレス
18
18
  char name[256]; //氏名
@@ -30,6 +30,7 @@
30
30
 
31
31
  while(p != NULL){
32
32
 
33
+ ```
33
34
  この後なんですが、fgetsでchar型のbufに入れた文字列と、構造体の中のchar型のnameに入っている文字列が部分的に一致しているかを調べるにはどうすればよいでしょうか?
34
35
  if(strcmp()
35
36
  でやろうと思ったのですが、それでは部分的に一致しているかがわからないので・・・