What is the result of the following code?#include <stdio.h>int main() { int arr[5] = {1, 2, 3, 4, 5}; int *ptr = (int *)(&arr + 1); printf("%d\n", *(ptr - 1)); return 0;}
Question
What is the result of the following code?#include <stdio.h>int main() { int arr[5] = {1, 2, 3, 4, 5}; int *ptr = (int *)(&arr + 1); printf("%d\n", *(ptr - 1)); return 0;}
🧐 Not the exact question you are looking for?Go ask a question
Solution
The result of the code will be "5".
Here's the step by step explanation:
- An array of integers `
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.