[ create a new paste ] login | about

Link: http://codepad.org/EoqOgd6t    [ raw code | output | fork ]

C++, pasted on Jul 18:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>

using namespace std;

int main(int argc, char** argv) {
    volatile const int number = 45;
    const volatile int * constPoint = &number;
    cout << "constPoint " << (void*)constPoint << endl;
    int * point = (int *) constPoint;
    cout << "     point " << point << endl;
    * point = 54;
    cout << "&number " << (void*)&number << "; number " << number << endl;
    cout << "  point " << point   << "; *point " << *point << endl;
}


Output:
1
2
3
4
constPoint 0xffb7f2c4
     point 0xffb7f2c4
&number 0xffb7f2c4; number 54
  point 0xffb7f2c4; *point 54


Create a new paste based on this one


Comments: