What the heck am i doing wrong? I'm just trying to create a 8 bit unsigned variable.

Manfred Nowak svv1999 at hotmail.com
Wed May 21 19:58:47 UTC 2025


On Friday, 16 May 2025 at 19:04:24 UTC, WhatMeWorry wrote:
[...]
>     cast(uint8_t) b = cast(uint8_t) b + cast(uint8_t) 5;  //
[...]

Somehow I don't get close enough to the underlying problem:
```d
void main(){
   ubyte a;
   a= cast( ubyte) ( a + 5);
   assert( a == 5);

   import core.stdc.stdint;
   uint8_t b;
   b= cast( uint8_t) ( b + 5);
   assert( b == 5);
}
```



More information about the Digitalmars-d-learn mailing list