40 likes | 130 Views
Consider the assignment statement:. int a[] = {1 , 2, 3, 4 , 5}; What is the value of a[2]? (A) 3 (B) 2 (C) 4 (D) [2, 4, 6, 8, 10] (E) This produces an error. Which of the following are the same?. int foo [3]; foo * foo foo [0] & foo --- A & B B & C C & D
E N D
Consider the assignment statement: int a[] = {1, 2, 3, 4, 5}; • What is the value of a[2]? (A) 3 (B) 2 (C) 4 (D) [2, 4, 6, 8, 10] (E) This produces an error.
Which of the following are the same? intfoo[3]; • foo • *foo • foo[0] • &foo --- • A & B • B & C • C & D • They're all the same • They're all different
How many memory locations are reserved for this array? intfoo[3][4]; • 3 • 4 • 7 • 11 • 12
What gets printed? char foo[] = "hello, world!"; printf("%c%c%c", foo[2], foo[4], foo[7]); • "el_" • "loo" • "low" • "lol" • This causes a crash