c system functions for Integer to character to integer

Source: Internet
Author: User

Atoi (representing alphanumeric to integer) is a function that converts a string into an integer number http://baike.baidu.com/link?url= Vtp54jt5-ey5tl0gffd49bgrgk7x-cjgu6onypmms694itag7fsazs_0k3ixdaxukvumknxt5ap1xacuopq7pk

#include <stdlib.h>int main (void) {    int  n;     Char " 12345.67 " ;     = atoi (str);    printf ("int=%d\n", N);     return 0 ;}

The

Itoa is a widely used non-standard C language extension function. Because it is not a standard C-language function, it cannot be used in all compilers. However, most compilers (such as those on Windows) typically include this function in the <stdlib.h> header file. Http://baike.baidu.com/link?url=VTP54JT5-EY5TL0GFfd49bGrgK7x-CjgU6onYPMMS694itag7FSAZs_ 0K3IXDAXUKVUMKNXT5AP1XACUOPQ7PK

#include <stdlib.h><stdio.h>int main (void) {int number= 123456 ; Char string [];itoa (number,string,ten);p rintf ("  integer=%d string=%s\n", number,string); return0;}
View Code

C system functions for Integer to character to integer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.