How can you pass a string to a function in C?
A) Strings cannot be passed to functions in C.
B) By passing a string as a normal variable, like an integer or a float.
C) By using a pointer to the string as a function parameter.
D) By using a global variable to store the string.
Answer:
C) By using a pointer to the string as a function parameter.
Explanation:
In C, strings are typically represented as arrays of characters. To pass a string to a function, you use a pointer to the string as a function parameter. This allows the function to access and manipulate the string data.