Complete the following function:/* copy string2 to string1 */void strcopy(char string1[], char string2[]){ int i = 0; while (string2[i] != '\0') { string1[i] = string2[i]; i++; } ____}
A. return;
B. string1[i - 1] = '\0';
C. string1[i] = '\0';
D. string1[i + 1] = '\0';
Answer: C
Computer Science & Information Technology
You might also like to view...
The move toward access instead of ownership is a sign of collaborative consumption
Indicate whether the statement is true or false
Computer Science & Information Technology
Answer the following statements true (T) or false (F)
1. C++ does not perform array bounds checking. 2. A pointer can be passed as an argument to a function. 3. Any arithmetic operation may be performed on pointers. 4. The ampersand (&) is used to dereference a pointer variable in C++. 5. The expression *s->p; is only meaningful if s is a pointer to a structure and p is a pointer that is a member of that structure.
Computer Science & Information Technology