I've written the following C function but it is not working correctly. What did I do wrong? int *double5(void) { int i = 5; i = i *2; return &i;} Group of answer choices You can never return a pointer to a local variable. It's not possible for a function to return a pointer The variable has to be a global variable The function has to be of type void
I've written the following C function but it is not working correctly. What did I do wrong? int *double5(void) { int i = 5; i = i *2; return &i;} Group of answer choices You can never return a pointer to a local variable. It's not possible for a function to return a pointer The variable has to be a global variable The function has to be of type void
Related questions
Question
- I've written the following C function but it is not working correctly. What did I do wrong?
int *double5(void) {
int i = 5;
i = i *2;
return &i;
}
Group of answer choices
You can never return a pointer to a local variable.
It's not possible for a function to return a pointer
The variable has to be a global variable
The function has to be of type void
AI-Generated Solution
Unlock instant AI solutions
Tap the button
to generate a solution