[ create a new paste ] login | about

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

C++, pasted on Mar 19:
1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
using namespace std;

static const char c[] = "0123456789";
static const char (&a)[5] = reinterpret_cast<const char (&)[5]>(c);
static const char (&b)[5] = reinterpret_cast<const char (&)[5]>(c[5]);

int main()
{
    cout << a[2] << ' ' << b[2]; // Prints 2 7
}


Output:
1
2 7


Create a new paste based on this one


Comments: