0

I just wondered if it is safe to change the datatypes of a dll import method parameters from "Int32" to "int" or "Int16" to "short". I know that it should be the same compilerwise, but I'm insecure if the imported method is still recognized.

Thanks in advance

Regards

ProgrammingLlama
  • 36,677
  • 7
  • 67
  • 86
epanalepsis
  • 853
  • 1
  • 9
  • 26
  • 1
    look [here](https://stackoverflow.com/questions/62503/should-i-use-int-or-int32), they are kind-of-alias. – vasily.sib Jun 28 '19 at 07:22
  • The underlying type of `int` is `System.Int32` and the underlying type for `short` is `System.Int16`, so yes, it should work. But why not just test it? – MindSwipe Jun 28 '19 at 07:22
  • Because some hardware is needed for the 3rd party dll, which I don't have at the moment. I'm just refactoring the code :) It will be tested aftwerwards but I want to avoid a return. – epanalepsis Jun 28 '19 at 07:27

1 Answers1

1

Yes, these types are interchangeable.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490