Questions tagged [int32]

int32 is a datatype that represents an integer and is coded on 32 bits in memory.

int32 is a datatype that represents an (a whole number, not a fraction) and is coded on 32 bits in memory. Unlike its counterpart which is , int32 can be used to store positive and negative integers, of values between -231 to 231 - 1.

187 questions
2
votes
2 answers

Apparently it's important to use Int32 instead of int when messing with DLLImport stuff?

In C#, when messing with that system DLLImport/(unmanaged?) code stuff, I read somewhere it's important to use Int32 exact type instead of int. Is this true? And can someone please elaborate on why it's important to do this?
Rudi
  • 31
  • 1
2
votes
8 answers

Min and Max value of integral type in C#

Whats the mathematical formulae to calculate the MIN and MAX value of an integral type using your calculator. I know you can use Integer.Max or Integer.Min etc or look it up on msdn however I want to know how to calculate it.
Jonathan
  • 2,318
  • 7
  • 25
  • 44
2
votes
2 answers

Specifying variable in Python

I am making an TF2 backpack viewer in Python, and I have inventory token that is an 32 unsigned long. First 16 bits are unimportant for me. Usual approach in C would be something like (a<<16)>>16 to get last 16 bits. But Python is no C, and it…
RomaValcer
  • 2,786
  • 4
  • 19
  • 29
2
votes
3 answers

How do I add 3 bytes and return an integer number?

Lets assume that I have a hex string of 00 00 04 01 11 00 08 00 06 C2 C1 BC With this the 7th, 8th, and 9th octet are a number I need to generate. The hex is 00 06 C2 This number turns out to be 1730. With the following, how can I simplify…
Gabriel Graves
  • 1,751
  • 1
  • 22
  • 40
2
votes
1 answer

Converting Hexidecimal Strings to Numeric Types and back

I need a function to convert hex values in the format 0xFFFF (2 Bytes) to decimal (unsigned and signed). For example: 0xFFFE is 65534 (unsigned) 0xFFFE is -2 (signed) I need also the same thing for 4 Bytes and 1 Byte. All these…
cheziHoyzer
  • 4,803
  • 12
  • 54
  • 81
2
votes
2 answers

How does Int32.Parse() exactly parse the String?

I am a novice C# learner. I know the basic concepts of this language. While revising the concepts, I stumbled upon one problem - How does Int32.Parse() exactly work? Now I know what it does and the output and the overloads. What I need is the exact…
Gaurang
  • 1,391
  • 1
  • 13
  • 16
1
vote
1 answer

64bit DLL works in VB.net but not in VBA

I have a 64 bit DLL which I want to use in VBA. The example from VB.net won't work in VBA as Int32 is not a known VBA data type. Is it possible to get this working in VBA? If so, do I have to write my own class? I'm including a few lines of the…
Brendan
  • 43
  • 6
1
vote
1 answer

(C-Program) example Code about Array Address

#include #include int32_t a = 0; void do_stuff(int32_t* c){ int32_t static b = 2; printf("Address: %p\n", c+a); printf("%d %d\n", *(c+a),c[b]); a+=4; b+=b^b; } int main() { int32_t array[9] = {42, 5,…
student
  • 15
  • 3
1
vote
1 answer

C# - Convert a List System.Object[] to List System.Int32[]

i'm new to C#, I'm trying to use a function that as been created here Actually i don't know how to return a list as array as a parameter. This function right here will use the "write" method of Odoo API. public void SetFieldValue(string field,…
Gabin
  • 61
  • 8
1
vote
2 answers

C# convert XML Node string to Int32

I reading data from webservice and is not clean. I need to convert string to Int where string can be null, number or with white spaces. I make simple program to achieve this but with whitespaces my code does not hit ... If…
K.Z
  • 5,201
  • 25
  • 104
  • 240
1
vote
2 answers

Is it safe to assume an Integer will always be 32 bits in VB.Net?

Related: Is it safe to assume an int will always be 32 bits in C#? The linked question asks whether it is "safe to assume that an int will always be 32 bits in C#". The accepted answer states that "the C# specification rigidly defines that int…
Brian Beckett
  • 4,742
  • 6
  • 33
  • 52
1
vote
2 answers

I need to find maximum int32_t number without using constants like INT32_MAX, INT_MAX, etc

So I have a task to check for overflow when adding two int32_t numbers. In case of overflow my function must return maximum or minimum number of int32_t, depending on the sign of overflow, but using constants like UINT32_MAX is restricted. How do I…
Demo_13B
  • 45
  • 1
  • 3
1
vote
2 answers

How do I cast an UInt32 to a (negative) Int32 in PowerShell?

I have the following number of type System.UInt32: 4.294.967.176 (in bytes: FFFF FF88). I have to interpret this number as a number of type System.Int32, where it will be: -120 (in bytes still: FFFF FF88). In languages like C or C++ a simple type…
stackprotector
  • 10,498
  • 4
  • 35
  • 64
1
vote
1 answer

How to convert GUID to int32?

I have the following GUID 0d9fc5f5-f2f2-477c-a876-a6ece127ea60 Is there an only tool converter. Or Can I use some C# lib to do the conversion
ABID KHAN
  • 35
  • 6
1
vote
1 answer

How to check for overflow of pow in C?

I want to calculate x^y (power of x to y) where x and y are both int32_t's. The result should be the same. If there is an overflow (also meaning: outside the bound of an int32_t, I want to catch that overflow - preferably before it even happens. How…
Dr.Kameleon
  • 22,532
  • 20
  • 115
  • 223