text cover

Data Abstraction and Problem Solving with C++

Walls and Mirrors

by Frank M. Carrano

Addison Wesley Logo

SelfTest1.cpp

Go to the documentation of this file.
00001 
00015 // Self-Test 1
00016 
00017 #include <iostream>
00018 using namespace std;
00019 
00020 int main()
00021 {
00022    int *p = new int;
00023    int *q = new int;
00024    cout << p << " " << q << endl;
00025 
00026    *p = 7;
00027    *q = 11;
00028    int *r = q;
00029    cout << *p << " " << *q << " " << *r << endl;
00030 
00031    *r = *q + *p;
00032    cout << *p << " " << *q << " " << *r << endl;
00033 
00034    q = new int;
00035    *q = 4;
00036    cout << *p << " " << *q << " " << *r << endl;
00037 
00038    delete r;
00039    r = NULL;
00040 
00041    return 0;
00042 }  // end main

Generated on Sun Aug 27 13:05:37 2006 for AWLogo by  doxygen 1.4.6