Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
import std.stdio;
void main()
{
writeln( "Hello, world!");
}with_open_file("foo.txt", "rw", (File fd) {
fd.read(...);
});void with_open_file(string name, string access, void delegate(File file) dg) {
fd = File(name, access);
scope(exit) fd.close;
dg(fd);
}with_open_file("foo.txt", "rw", getProcessDelegate());with_open_file("foo.txt", "rw", delegate void (File fd) {
fd.read(...);
});fopen(f, "foo.txt", "rw"); scope(exit) close(f); fread(...);
auto ptr = new char[512];
Место для D