On Wednesday, 27 December 2023 at 20:20:23 UTC, tososdk wrote:
I was recreating some code from C++ to D:
[...]
But since I am somewhat new to these topics and even more so to
Dlang, I don't understand very well. The problem occurs in the
creation of the .wav, regarding rawWrite, I'm not
Because WaveHeader has no pointers in it, only raw memory, assuming it
is all in the cpu endianesss and with ``align(1)`` you can slice that
block of stack memory and write from that.
```d
file.rawWrite((cast(ubyte*))[0 .. WaveHeader.sizeof]);
```
However I would recommend doing it field by
I was recreating some code from C++ to D:
```
import std.stdio;
import std.file;
import std.string;
import std.math;
struct WavHeader {
char[4] riff;
int flength;
char[4] wave;
char[4] fmt;
int chunk_size;
short format_tag;
short num_chans;
int sample_rate;
On Wednesday, 27 December 2023 at 16:35:47 UTC, Paul Backus wrote:
On Wednesday, 27 December 2023 at 15:57:14 UTC, tososdk wrote:
Two things: Could you explain how "inline" works? Is there
something similar in Dlang?
I don't think the D forums is the best place to ask about how
"inline"
On Wednesday, 27 December 2023 at 15:57:14 UTC, tososdk wrote:
Two things: Could you explain how "inline" works? Is there
something similar in Dlang?
In C and C++, `inline` is a suggestion to the compiler that it
should consider using [inline expansion][1] for calls to a
particular function.
On Wednesday, 27 December 2023 at 14:41:05 UTC, Christian Köstlin
wrote:
One option (not tested) should be to close stdin so that readln
then returns null or something on eof.
Shutting down threads is always tricky.
It would be great if there would be one or two (perhaps one
synchronous, one
On Wednesday, 27 December 2023 at 05:07:04 UTC, Joe wrote:
??? Surely there there is a
one liner library solution for this?
I have a program that spawns a thread for debugging information
and uses the keyboard input which allows me to display the
On Wednesday, 27 December 2023 at 14:03:06 UTC, Kagamin wrote:
Maybe you're not supposed to print text while reading?
In parallel I have contacted schveiguy on discord and he found
the culprid. But we do not have a solution yet. It probably will
result in a bugreport at
Maybe you're not supposed to print text while reading?
Maybe write and read lock each other, try to use puts:
```
bool done = false;
while (!done) {
puts("1");
auto result = ["echo", "Hello World"].execute;
if (result.status != 0)
{
writeln(2);
throw new Exception("echo
On Wednesday, 27 December 2023 at 05:07:04 UTC, Joe wrote:
??? Surely there there is a
one liner library solution for this?
It is not one line because it needs a bit of setup (and teardown,
but the objects' destructors do that for you) but it is close:
Hi, you all !
I've wanted to look at D for the last two years, being a C fanboy
and not fond of C++.
It seemed like a good alternative between some delightful extra
new stuff and keeping C-like experience : performances and code
style wise.
I wrote my first CLI program this weekend and
12 matches
Mail list logo