This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std; | |
void main() | |
{ | |
string point; | |
void * pointeraddress = &point; | |
string[void *] associative; | |
associative[pointeraddress] = "someinformation"; | |
writeln("Hello D ", pointeraddress); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
importd.stdio, std.array, std.algorithm; | |
void main() | |
- | |
stdin | |
.byLineCopy | |
.array | |
.sort!((a, b) > a > b) // absteigende Bestellung | |
.jetzt; | |
- |