Does anyone know what I am doing wrong

A. Complete the Pointer Program (30 pts)

Complete the following program:
Include the comments below with your code and use the variable names provided. Your output must match the sample output, except for the addresses which will be different. Why will the addresses be different???

// Lab4_ExerA.cpp
// CSC134 - Lab 4 - Exercise A
// Name:
//
// State in words what this program is doing

#include <iostream>
using namespace std;

int main()
{
int value1 = 2000;
int value2;

// DECLARE the variable iPtr to be a pointer to an
// object of type int

// ASSIGN the address of variable value1 to pointer
// variable iPtr

// PRINT the value of the object pointed to by iPtr

// ASSIGN the value of the object pointed to by iPtr
// to value2

// PRINT the value of value2

// PRINT the address of value1

// Print the address stored in iPtr


}

Sample Output:

Value of object pointed to by iPtr is 2000
Value of value2 is 2000
Address of value1 is 0034FA90
Address stored in iPtr is 0034FA90
Well, you aren't doing anything that the comments say you should be doing.
Topic archived. No new replies allowed.