Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can someone help me with my study guide please!! THANKS!! 1) ____ creates a new

ID: 3694665 • Letter: C

Question

Can someone help me with my study guide please!! THANKS!!

1) ____ creates a new data type without actually reserving any storage locations.

a. struct {int month; int day; int year;} birth;

b. struct {int month; int day; int year;} birth, current;

c. struct Date {int month; int day; int year;};

d. struct Date {int month; int day; int year;} birth;

2) Line 5 in the function below can be replaced with ____. 1 void strcopy (char string1[], char string2[]) 2 { 3 int i = 0; 4 5 while (string2[i] != '') 6 { 7 string1[i] = string2[i]; 8 i++; 9 } 10 string1[i] = ''; 11 }

a. while (string2[i])

b. while (!string2[i])

c. while (string2[i] < '')

d. while (string2[i] != ' ')

3) Pointers ____ be initialized when they are declared.

a. Must

b. Must not

c. Can

d. Can not

4) Adding ____ to a pointer causes the pointer to point to the next element of the original data type being pointed to.

a. 1

b. 1 * sizeof(data type being pointed to)

c. 2

d. 2 * sizeof(data type being pointed to)

5) ____ is not a valid C statement.

a. struct {int month; int day; int year;} birth;

b. struct {int month; int day; int year;} birth, current;

c. struct Date {int month; int day; int year;};

d. struct {int month, int day, int year} birth;

6) char codes[] = "sample"; sets aside ____ elements in the codes array.

a. 5

b. 6

c. 7

d. 8

7)A file stream that sends data to a file is referred to as a(n) ____.

Input file stream

Output file stream

Data file

Binary file

8) Line ____ in the following section of code checks for the end-of-string character.

1 void strcopy (char string1[], char string2[])

2 {

3   int i = 0;

5   while (string2[i] != '')

6   {

7     string1[i] = string2[i];

8     i++;

9   }

10   string1[i] = '';

11 }

3

5

7

10

9) The ____ function continuously accepts and stores the characters typed at the terminal into the character array passed as an argument.

gets()

puts()

getchar()

putchar()

10) The actual declaration of the FILE structure is contained in the ____ standard header file.

stdio.h

stdlib.h

file.h

stream.h

11) When using #include, the characters ____, tell the compiler to begin searching for the included file in the C compiler system library directory.

“”

<>

//

\

12) The function call ____ passes a copy of the complete emp structure to calcNet().

calcNet(struct emp);

calcNet(*emp);

calcNet(&emp);

calcNet(emp);

Explanation / Answer

1. c) struct Date {int month; int day; int year;};

creates a new data type without actually reserving any storage locations.

2. while (!string2[i])

3. Pointers can be initialized when they are declared. Its not necessary to initialise while declaring but before using/derefencing it must be initialised

4. ) Adding 1 to a pointer causes the pointer to point to the next element of the original data type being pointed to.

7. OUTput stream

11. <>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote