0
I'm confused. What does the "Convert.ToInt32" statement do? I keep seeing it throughtout the course lessons, but don't remember the app talking about it.
5 Réponses
+ 3
It would cast any primitive type ( it takes int as well as strings or chars ) and convert them to a 32-bit signed integer.
You can use parsing as well: int.Parse( string ) if you know the string is going to be an int, or int.TryParse(string, out int x) if you are not sure about it, which will return a bool, and if it is true, you can run it in an if statement and you will have the expected number in x.
0
@Elie Saad What is a 32 bit signed integer, and what are they used for?
0
In the .NET framework, signed integers are used. The size of a signed integer goes up to 2^31 - 1 and can go to the negative of that value. The difference between the signed and unsigned is that signed take the 32th bit and uses it for either positive value (0) and negative for (1).
0
do the signed help manage memory resources?
0
It convert other datatype values to integer . you can use int.parse also