Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Laboratory Exercise 011

1.
Flowchart Pseudocode

START DECLARE x

SET x TO 900

OUTPUT “The value of x is “ + x + “.”


DECLARE
OUTPUT “The address of x is “ + &x + “.”
x
END

x = 900

DISPLAY “The value


of x is “ + x + “.”

DISPLAY “The address


of x is “ + &x + “.”

END
2.
Flowchart Pseudocode

DECLARE x[10]
START
SET *pointer TO &x[0]

DISPLAY “The value of x is “ + x[0] + “.”

DISPLAY “The address of x is “ + (void*)&x[0] + “.”


DECLARE
x[10],*pointerx

*pointer = &x[0]

DISPLAY “The value


of x is “ + x[0] + “.”

DISPLAY “The address of x is


“ + (void*)&x[0] + “.”

DISPLAY “The pointer


is “ + *pointerx + “.”

END
3.
Flowchart Pseudocode

DECLARE x[20], &refx


START
SET &refx TO x[0]

DISPLAY “The value of x is “ + x[0] + “.”

DISPLAY “The address of x is “ + (void*)&x[0] + “.”


DECLARE
x[20],&refx DISPLAY “The reference is “ + refx + “.”

END

&refx = x[0]

DISPLAY “The value


of x is “ + x[0] + “.”

DISPLAY “The address of x is


“ + (void*)&x[0] + “.”

DISPLAY “The reference


is “ + refx + “.”

END
4. Conclusion:
I therefore conclude that this activity really challenged my logical understanding of C++. I also
been able to use pointer variables for primitive data type as well as arrays.

You might also like