June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -1 +1,3 @@
|
|||
int& i = *(int*)0xA100;
|
||||
#include <memory>
|
||||
int i;
|
||||
auto address_of_i = std::addressof(i);
|
||||
|
|
|
|||
|
|
@ -1,5 +1 @@
|
|||
static union
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
};
|
||||
int& i = *(int*)0xA100;
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
int i;
|
||||
int& j = i;
|
||||
#include <new>
|
||||
struct S { int i = 0; S() {} };
|
||||
auto& s = *new (reinterpret_cast<void*>(0xa100)) S;
|
||||
|
|
|
|||
5
Task/Address-of-a-variable/C/address-of-a-variable-5.c
Normal file
5
Task/Address-of-a-variable/C/address-of-a-variable-5.c
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
static union
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
};
|
||||
2
Task/Address-of-a-variable/C/address-of-a-variable-6.c
Normal file
2
Task/Address-of-a-variable/C/address-of-a-variable-6.c
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
int i;
|
||||
int& j = i;
|
||||
4
Task/Address-of-a-variable/C/address-of-a-variable-7.c
Normal file
4
Task/Address-of-a-variable/C/address-of-a-variable-7.c
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#include <cstring>
|
||||
inline float read_as_float(int const& i) { float f; memcpy(&f, &i, sizeof(f)); return f; }
|
||||
int i = 0x0a112233;
|
||||
float f = read_as_float(i);
|
||||
Loading…
Add table
Add a link
Reference in a new issue