[ create a new paste ] login | about

Link: http://codepad.org/tNlZoNkE    [ 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 " << constPoint << endl;
    int * point = (int *) constPoint;
    cout << "     point " << point << endl;
    * point = 54;
    cout << "&number " << &number << "; number " << number << endl;
    cout << "  point " << point   << "; *point " << *point << endl;
}


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


Create a new paste based on this one


Comments: