Question
// C Programming #include int func6(int a, int *b) { int c; c = a; a = *b + c; printf(func6: %d %d %d ,a,
// C Programming
#include
int func6_8(int *a, int b) { int c; c = *a; *a = b + c; printf("func6_8: %d %d %d ",*a, b, c); return(c); }
int func6_84(int *a, int b) { int c; c = *a; a = &c; *a = b + c; printf("func6_84: %d %d %d ",*a, b, c); return(c); }
int main() { int *ptr, *a; int b, c; int d[10];
b = 10 + 6; c = 10 + 6; ptr = &b; a = &b; for (b = 0; b
//*ptr = ____ //*a = ____ //b = ____ //c = ____ //d = ____ ____ ____ ____ ____ ____ ____ ____ ____ ____
b = 4 + 17; c = 8; //*ptr = ____ //*a = ____ //b = ____ //c = ____ //d = ____ ____ ____ ____ ____ ____ ____ ____ ____ ____
for (c = 0; c
//*ptr = ____ //*a = ____ //b = ____ //c = ____ //d = ____ ____ ____ ____ ____ ____ ____ ____ ____ ____
a = &c; for (c = 0; c
//*ptr = ____ //*a = ____ //b = ____ //c = ____ //d = ____ ____ ____ ____ ____ ____ ____ ____ ____ ____
ptr = &d[4]; a = &d[3]; for (*a = 1; *a
//*ptr = ____ //*a = ____ //b = ____ //c = ____ //d = ____ ____ ____ ____ ____ ____ ____ ____ ____ ____
printf("-- %d -- ", *d + 14); printf("-- %d -- ", ptr[41 % 5] + 14); func6(d[6], &d[4]); //*ptr = ____ //*a = ____ //b = ____ //c = ____ //d = ____ ____ ____ ____ ____ ____ ____ ____ ____ ____
func6_8(&d[6], d[4]); //*ptr = ____ //*a = ____ //b = ____ //c = ____ //d = ____ ____ ____ ____ ____ ____ ____ ____ ____ ____
func6_84(&d[6], d[4]); //*ptr = ____ //*a = ____ //b = ____ //c = ____ //d = ____ ____ ____ ____ ____ ____ ____ ____ ____ ____
d[6] = func6(d[6], &d[4]); //*ptr = ____ //*a = ____ //b = ____ //c = ____ //d = ____ ____ ____ ____ ____ ____ ____ ____ ____ ____
printf(" "); return(0); }
You are to turn in a text file that includes all output from the program as well as all of the variable values at the requested locations The code generated "should" all be valid, but if there are any lines that access arrays beyond their size, you are to correct the errors by changing the invalid values to the maximum value that would be allowed So in other words, if x is a size 10 array and your homework includes the following line: you should change this to: x [9114; And make a note in the document you turn in that you made this change
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started