Skip to content

Instantly share code, notes, and snippets.

View run-dlang's full-sized avatar

Eleanor Cross run-dlang

View GitHub Profile
@run-dlang
run-dlang / main.d
Created September 29, 2023 11:37
Code shared from run.dlang.io.
import std;
// Proof of concept.
// Out of scope access to a variable using stored pointer, demonstration.
void outofcontext()
{
writeln("Hello D ", associative);
foreach (pointeraddress, information; associative)
{
@run-dlang
run-dlang / main.d
Created September 29, 2023 11:18
Code shared from run.dlang.io.
import std;
// Out of context access to a variable.
void outofcontext(){
foreach (i, assoc; associative){
writeln("test", i, assoc);
string * tes = cast(string *)i;
writeln(*tes);
@run-dlang
run-dlang / main.d
Created September 29, 2023 07:08
Code shared from run.dlang.io.
import std;
void main()
{
string point;
void * pointeraddress = &point;
string[void *] associative;
associative[pointeraddress] = "someinformation";
writeln("Hello D ", pointeraddress);
@run-dlang
run-dlang / main.d
Created September 29, 2023 06:53
Code shared from run.dlang.io.
import std;
void main()
{
byte a = 2;
ulong b = 50000000000UL;
long c = -10000L;
ubyte d = 130;
writeln("a(byte)=",a);
writeln("b(ulong)=",b);
writeln("c(long)=",c) ;
@run-dlang
run-dlang / main.d
Created September 29, 2023 06:30
Code shared from run.dlang.io.
import std.stdio;
void main() {
ubyte a = 200;
ulong b = 50000000000UL;
uint c = 10000;
long d = -100;
writeln("Значение переменной a (ubyte): ", a);
writeln("Значение переменной b (ulong): ", b);
@run-dlang
run-dlang / main.d
Created September 28, 2023 10:38
Code shared from run.dlang.io.
// Library for creating, resizing and managing memory blocks.
import core.stdc.stdio;
import core.stdc.stdlib;
alias heap = malloc; // memory allocation function
alias heapInit = calloc; // memory allocation with initialization.
alias resizeHeap = realloc; // change allocated memory.
alias release = free; // Release memory block
@run-dlang
run-dlang / main.d
Created September 28, 2023 10:24
Code shared from run.dlang.io.
// Library for creating, resizing and managing memory blocks.
import core.stdc.stdio;
import core.stdc.stdlib;
alias heap = malloc; // memory allocation function
alias heapInit = calloc; // memory allocation with initialization.
alias resizeHeap = realloc; // change allocated memory.
alias release = free; // Release memory block
@run-dlang
run-dlang / main.d
Created September 28, 2023 10:07
Code shared from run.dlang.io.
// Library for creating, resizing and managing memory blocks.
import core.stdc.stdio;
import core.stdc.stdlib;
alias heap = malloc; // memory allocation function
alias heapInit = calloc; // memory allocation with initialization.
alias resizeHeap = realloc; // change allocated memory.
alias release = free; // Release memory block
@run-dlang
run-dlang / main.d
Created September 28, 2023 09:45
Code shared from run.dlang.io.
// Library for creating, resizing and managing memory blocks.
import core.stdc.stdio;
import core.stdc.stdlib;
alias heap = malloc; // memory allocation function
alias heapInit = calloc; // memory allocation with initialization.
alias resizeHeap = realloc; // change allocated memory.
alias release = free; // Release memory block
@run-dlang
run-dlang / main.d
Created September 28, 2023 09:15
Code shared from run.dlang.io.
importd.stdio, std.array, std.algorithm;
void main()
-
stdin
.byLineCopy
.array
.sort!((a, b) > a > b) // absteigende Bestellung
.jetzt;
-