2

What is the difference between the following expressions?

 (short)(l_angle/l_msb * dividend)

and

 short(l_angle/l_msb * divident)

I guess the first one is type casting to short type but what does the second expression do? If it is also typecasting, how is it different from the first?

Grijesh Chauhan
  • 57,103
  • 20
  • 141
  • 208
Majid Khan
  • 111
  • 2
  • 14

1 Answers1

1

It's the same thing... There's no difference.

  • C style cast: (int)X
  • C++ style cast: static_cast<int>(X)
  • Constructor syntax cast: int(X)
Wagner Patriota
  • 5,494
  • 26
  • 49