int is always 32-bit?
-
Hello everyone, When using "int", it is always 32-bit? No matter whether we make build option as Any CPU, x86 and x64? thanks in advance, George
-
Hello everyone, When using "int", it is always 32-bit? No matter whether we make build option as Any CPU, x86 and x64? thanks in advance, George
If you want a larger (or smaller) integer, use
Int64
orInt16
. An int is as big as the compiler defines it to be."Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
If you want a larger (or smaller) integer, use
Int64
orInt16
. An int is as big as the compiler defines it to be."Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001Thanks John, Answer to my original question is, int is always 32-bit no matther what platform and build option (Any CPU/x86/x64) is used? :-) regards, George
-
Thanks John, Answer to my original question is, int is always 32-bit no matther what platform and build option (Any CPU/x86/x64) is used? :-) regards, George
no. visual c++ 1.2 (and turbo pascal) defined an int as 16-bit. Starting with Visual C++ 2.0, an int was 32 bit.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
Hello everyone, When using "int", it is always 32-bit? No matter whether we make build option as Any CPU, x86 and x64? thanks in advance, George
-
Hello everyone, When using "int", it is always 32-bit? No matter whether we make build option as Any CPU, x86 and x64? thanks in advance, George
-
Hello everyone, When using "int", it is always 32-bit? No matter whether we make build option as Any CPU, x86 and x64? thanks in advance, George
Just to add to the pot: The C# keyword
int
is a compiler accessor to the System.Int32 type. You may use the below code to validate this as an excercise on each platform:typeof(int) == typeof(System.Int32)
The above code will return
true
./F - .NET Developer
-
If you want a larger (or smaller) integer, use
Int64
orInt16
. An int is as big as the compiler defines it to be."Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001John Simmons / outlaw programmer wrote:
An int is as big as the compiler defines it to be
Wrong language John? :)
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Hello everyone, When using "int", it is always 32-bit? No matter whether we make build option as Any CPU, x86 and x64? thanks in advance, George
-
no. visual c++ 1.2 (and turbo pascal) defined an int as 16-bit. Starting with Visual C++ 2.0, an int was 32 bit.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001Thanks John, My context is C#. Any comments or answers to my original question? regards, George
-
George_George wrote:
When using "int", it is always 32-bit?
Yes. In C# an int is always 32 bits. The keyword
int
is an alias for the typeSystem.Int32
.Despite everything, the person most likely to be fooling you next is yourself.
Cool, thanks Guffa! regards, George
-
John Simmons / outlaw programmer wrote:
An int is as big as the compiler defines it to be
Wrong language John? :)
Mark Salsbery Microsoft MVP - Visual C++ :java:
Yes, it is C# forum. :-) regards, George
-
Just to add to the pot: The C# keyword
int
is a compiler accessor to the System.Int32 type. You may use the below code to validate this as an excercise on each platform:typeof(int) == typeof(System.Int32)
The above code will return
true
./F - .NET Developer
Cool, thanks ElSpinos! regards, George
-
Good link, thanks Greeeg! regards, George
-
Good link, thanks PIEBALDconsult! regards, George