Hello,
Here is a code that you can execute using online compiler https://run.dlang.io/:

import std.stdio;
void main()
{
   ushort first = 5;
   ushort second = 1000;

   ushort result = first + second;

   writeln(result);
}

I hae this error:
onlineapp.d(7): Error: cannot implicitly convert expression cast(int)first + cast(int)second of type int to ushort

Why they are "int" when I declared them as "ushort"???
ushort + ushort = ushort, not int.

In C++ there aren't any such issues...

Reply via email to