Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following c++ pseudocode. Indicate what will be displayed by the ps

ID: 664750 • Letter: C

Question

Consider the following c++ pseudocode. Indicate what will be displayed by the pseudo-code print and. Write what exactly is gonna be printed out after running the program. Justify values for
the variables getting printed out based on the scope. Remember to add any possible detail.

int myNum1
refToInt myNumPtr1
int myNum2
refToInt myNumPtr2
myNumPtr1 = &myNum1
myNumPtr2 = &myNum2
myNum1 <-- 5

myNum2 <-- 7
(*myNumPtr1) = *(&myNum1) + myNum1
(*myNumPtr2) = *(&myNum2) + myNum2
print myNum1
print myNum2
myNumPtr2 = myNumPtr1
(*myNumPtr1) = *(&myNum1) + myNum1

(*myNumPtr2) = *(&myNum2) + myNum2
print myNum1
print myNum2

Explanation / Answer

Displayed by the pseudo-code print

if you run profram you will get compilation error

&myNum1 Pointers can be used to access a variable by its address, and this access may include modifying the value pointed. But it is also possible to declare pointers that can access the pointed value to read it, but not to modify it.pointers are meant to point to valid addresses, such as the address of a variable or the address of an element in an array. But pointers can actually point to any address, including addresses that do not refer to any valid element.

I think this information is sufficient for you.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote