C
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
Runtime options...
- voluntas
- @ignis_fatuus
- ブン
- @Linda_pp
- 清楚なC++メイドBOT
- @tzik_tack
- 長谷川一輝
- wraith13
- @jj1bdx
- @cpp_akira
- 安藤敏彦
- @srz_zumix
- Siv3D
- takezoh
- まろ
- @okdshin
- @hnokx
- @ishidakei
- @take_cheeze
- TAKEI Yuya
- @mumumu
- 黒澤 亮二
- I (@wx257osn2)
- Tommy6
- イズカワタカノブ
- @tyottyoworks
- ___shanon
- わたやん
- @KorekaraSEDB
- @kariya_mitsuru
- @ciniml
- @beam2d
- @grafi_tt
- @nekketsuuu
- LouiS0616
- @volanja
- 大鎌広
- むてら
- ガチKGB
x
79
if (strcmp(try_again, "Yes") == 0 || strcmp(try_again, "yes") == 0 || (int) try_again == 89 || (int) try_again == 121)
1
//#include <cs50.h>
2
3
4
5
typedef char* string;
6
int get_int(const char* x) { return 42; }
7
string get_string(const char* x) { return "hoge"; }
8
9
// new type for storing list of name and phone numbers.
10
typedef struct
11
{
12
string name;
13
string number;
14
}
15
person;
16
17
void search(int count, person people[]);
18
19
int main(void)
20
{
21
// get the user input for how many person you want
22
int person_count = get_int("How many person is there? : ");
23
24
// create people and the length of the array
25
person people[person_count];
26
27
// make the repertoire for each person on the list
28
for (int i = 0; i < person_count; i++)
$ gcc prog.c -Wall -Wextra -std=gnu11
Start
prog.c: In function 'get_int': prog.c:6:25: warning: unused parameter 'x' [-Wunused-parameter] 6 | int get_int(const char* x) { return 42; } | ~~~~~~~~~~~~^ prog.c: In function 'get_string': prog.c:7:31: warning: unused parameter 'x' [-Wunused-parameter] 7 | string get_string(const char* x) { return "hoge"; } | ~~~~~~~~~~~~^ prog.c: In function 'search': prog.c:56:9: error: expected expression before '}' token 56 | } | ^ prog.c:56:9: warning: 'return' with a value, in function returning void [-Wreturn-type] prog.c:41:6: note: declared here 41 | void search(int count, person people[]) | ^~~~~~ prog.c:58:5: error: 'else' without a previous 'if' 58 | else | ^~~~ prog.c:72:79: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 72 | if (strcmp(try_again, "Yes") == 0 || strcmp(try_again, "yes") == 0 || (int) try_again == 89 || (int) try_again == 121) | ^ prog.c:72:104: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 72 | if (strcmp(try_again, "Yes") == 0 || strcmp(try_again, "yes") == 0 || (int) try_again == 89 || (int) try_again == 121) | ^ prog.c:74:13: warning: implicit declaration of function 'sreach'; did you mean 'search'? [-Wimplicit-function-declaration] 74 | sreach(count, people); | ^~~~~~ | search prog.c:77:5: error: expected expression before '}' token 77 | } | ^ prog.c:77:5: warning: 'return' with a value, in function returning void [-Wreturn-type] prog.c:41:6: note: declared here 41 | void search(int count, person people[]) | ^~~~~~
1
Finish