Difference between long and int in C#?

后端 未结 6 657
日久生厌
日久生厌 2021-02-03 17:40

What is the actual difference between a long and an int in C#? I understand that in C/C++ long would be 64bit on some 64bit platforms(depending on OS o

6条回答
  •  时光取名叫无心
    2021-02-03 18:26

    Sure is a difference - In C#, a long is a 64 bit signed integer, an int is a 32 bit signed integer, and that's the way it always will always be.

    So in C#, a long can hold an int, but an int cannot hold a long.

    C/C++ that question is platform dependent.

提交回复
热议问题