In C, what is the effect of using pointers as function parameters with regards to pass by value and pass by reference?
- Pointers can only be used in pass by value scenarios.
- Pointers enable pass by reference.
- Pointers enable pass by value.
- Pointers have no impact on pass by value or pass by reference.
Using pointers as function parameters in C enables pass by reference. When a pointer to a variable is passed to a function, changes made to the variable within the function are reflected outside the function, similar to pass by reference.
Loading...
Related Quiz
- What is the purpose of using pointers to structures in C programming?
- How does the 'switch' statement compare to a series of 'if-else' statements in terms of efficiency?
- You are developing a large-scale simulation that runs for a long duration. After running for a few hours, you notice the program slows down significantly. What could be a likely reason for this behavior?
- What is the primary function of pointers in C?
- In C, the ________ function is used to write a string to a file.