Asked by Janysh Kudaibergenov on Jun 10, 2024
Verified
char codes[] = "sample"; sets aside ____ elements in the codes array.
A) 5
B) 6
C) 7
D) 8
Codes Array
An array that stores numerical codes, potentially representing characters, instructions, or other data.
- Gain insight into the purpose and operation of one-dimensional arrays and their initial setup.
Verified Answer
GL
Giovanni LeyvaJun 17, 2024
Final Answer :
C
Explanation :
The string "sample" consists of 6 characters, but in C, strings are null-terminated, meaning an extra character '\0' is automatically added at the end to mark the end of the string. Therefore, 7 elements are set aside in the array.
Learning Objectives
- Gain insight into the purpose and operation of one-dimensional arrays and their initial setup.