Link to home
Create AccountLog in
Avatar of zizi21
zizi21

asked on

Convert to integers

Hi,

In C to convert , i use atoi.

In C #, i found this Convert.ToInt32, Convert.ToInt16.

Which is recommended? Is there any other usual way of doing this.thanks
ASKER CERTIFIED SOLUTION
Avatar of ZachSmith
ZachSmith
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
You can also cast by saying something like:

long myLong = 67.99;

int myInt = (int)myLong;
Is there anything else you need to know about this?
Avatar of zizi21
zizi21

ASKER

thank you.

is there a difference between 16 and 32 ? which is commonly used.
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of zizi21

ASKER

thanks