July 30, 2022

On Thursday, 28 July 2022 at 23:08:15 UTC, frame wrote:

>

On Thursday, 28 July 2022 at 20:20:27 UTC, pascal111 wrote:

>

I retyped again some function of C library I made before, but with D code:

It's a start but you need to learn.

Thanks!

I made the equivalent of my C library "collect":
https://github.com/pascal111-fra/D/blob/main/dcollect.d

>
  • these functions can run into UB if you compile it without bound checking enabled

You are right, but I'm still in the beginning to learn all necessary concepts and features I need.

>
  • when working with arrays or ranges it's better to use unsigned integers or just use size_t which represents unsigned integer for 32 or 64 bit. This avoids negative values and enables the maxmium value which can be provided on the plattform to access the highest element in the array.

I tried to use now "uint".

>
  • It's sure advanced topic but you should start to check your input from the beginning. Try what happens if you apply negative numbers or invalid offsets ;-)

I don't know which client you are using but please have an eye on proper format of your posts - see the "Markdown formatting" or disable the Markdown option below your input.

I don't understand much the posting details of this forum.

>

https://forum.dlang.org/help#about

July 30, 2022

On Saturday, 30 July 2022 at 17:55:02 UTC, pascal111 wrote:

>

I don't understand much the posting details of this forum.

>

https://forum.dlang.org/help#about

It's simple: if you want to format/style your posts rather then just using plain text, enable the Markdown option. It's similar to Github-formatting.

Otherwise don't, because some tokens trigger a format where it makes no sense. To avoid that, just post in plain text mode by unchecking the option and make use of the preview option too.

1 2 3 4
Next ›   Last »