Question: I want to declare a pointer, have it hold a custom address and then assign a value to it: 

```
void main()
{
    char *ptr;
    ptr = (char *)0x123123; //the assignment works perfectly with a cast
    printf("%p\n", ptr); //and the pointer indeed holds the address it's supposed to
    *ptr = 'a'; //but this breaks
    puts("2");
}

```

Initially I thought the reason is because I'm trying to dereference uninitialized memory. But I doubt actually that this is the case, since this `some_type *some_ptr = &some_variable;` works flawlessly, so the deal must be the address I assign it to. 

Then I thought, in the same way `3` or `'a'` or `"alpine"` are constants, `(char *) 0x123123` must be a constant too. And `const`-s can't be edited in C, but that still can't be it, because an attempt to change a `const` value will not compile. 

3rd assumption would be that such an address must be unavailable, but this doesn't make sense either, because line 4 works always, no matter the address I give or the type of the `pointer`.

Answer: 
The OP clarified elsewhere, that this is actually an XY problem.

The X problem: reading/writing to arbitrary memory locations.

The Y problem: implementing a linked list that uses consecutive memory.

Of course, the answer to that is: one has to implement his complete own memory management system to get there. 

As in: first, you use `malloc()` to acquire a large block of consecutive memory. Then you can use *arbitrary* pointers **within** that block of memory. But of course, *your* code has to track which addresses are already used. Or to correctly "free" up when list nodes get deleted.

The tricky part is about handling the corner cases, such as: what happens when your last "pointer" gets used up? Do you malloc() a larger area, and **move** all data in memory? 

Finally: assume that you don't manage a block of memory, but a single array. ( linked lists implementations are often based on arrays, as that makes some things much easier )
writing to some arbitrary memory address is dangerous and not allowed by modern operating systems, better to create a memory blob and write to that. 

e.g. using malloc : 

```
ptr = malloc(32); // now you can write to this memory block and it perfectly legal
*ptr = 'a';

```