Re: Is sizeof() available in D language?

2023-09-04 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, September 4, 2023 2:34:08 PM MDT Olivier Pisano via Digitalmars-d- learn wrote: > On Monday, 4 September 2023 at 09:41:54 UTC, BoQsc wrote: > > I've seen everyone using **datatype**`.sizeof` property. > > > > https://dlang.org/spec/property.html#sizeof > > > > It's great, but I wonder

Hipreme's Tip of of the day #09 - Using D shared libraries with dub

2023-09-04 Thread Hipreme via Digitalmars-d-learn
Hello again! -- As of some requests in DConf, I'll post here some things related (or not) to dub recipes. Since there is so many ways to build D and dub is quite the main way, I'll try to show other uncommon ways to use it, this is more recommended to bigger projects since the standard one is

Re: Is sizeof() available in D language?

2023-09-04 Thread Olivier Pisano via Digitalmars-d-learn
On Monday, 4 September 2023 at 09:41:54 UTC, BoQsc wrote: I've seen everyone using **datatype**`.sizeof` property. https://dlang.org/spec/property.html#sizeof It's great, but I wonder if it differ in any way from the standard C function `sizeof()`. Technically speaking, in C, sizeof is not

Re: Is sizeof() available in D language?

2023-09-04 Thread user1234 via Digitalmars-d-learn
On Monday, 4 September 2023 at 09:41:54 UTC, BoQsc wrote: I've seen everyone using **datatype**`.sizeof` property. https://dlang.org/spec/property.html#sizeof It's great, but I wonder if it differ in any way from the standard C function `sizeof()`.

Is sizeof() available in D language?

2023-09-04 Thread BoQsc via Digitalmars-d-learn
I've seen everyone using **datatype**`.sizeof` property. https://dlang.org/spec/property.html#sizeof It's great, but I wonder if it differ in any way from the standard C function `sizeof()`. https://www.geeksforgeeks.org/sizeof-operator-c/ https://en.cppreference.com/w/cpp/language/sizeof

Re: I don't understand betterC

2023-09-04 Thread evilrat via Digitalmars-d-learn
On Monday, 4 September 2023 at 07:39:21 UTC, confused wrote: So then I guess I'd still like to know how I'm expected to store and access an array of characters without the C runtime as I tried in my original post. Without C runtime functions such as malloc you can still have fixed-length

Re: I don't understand betterC

2023-09-04 Thread confused via Digitalmars-d-learn
On Saturday, 2 September 2023 at 07:59:31 UTC, Jonathan M Davis wrote: If you put it into a package, then you could have your own object module that then isn't at the top level - e.g. mypkg/object.d with module mypkg.object; but you can't have more than one module in your program with the