Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What's the difference between atoi and (int) in C language to convert character types into plastic?
What's the difference between atoi and (int) in C language to convert character types into plastic?
Atoi converts characters (strings) into int and does not accept float, that is, if char a[4] = 12.3, then return is int i= 12.

But (int) is different. It can only convert a single element, such as the element in a[4] above, into ASCII code. For float and double variables, (int) gets the integer part of the number.

If you are satisfied, please adopt it.