c -atoi commonly used functions and itoa

atoi sum itoa

atoi function is to put a string into an integer

Action(){
    int j;
    char *s="222";
    j = atoi(s);
    lr_output_message("%d",j);
}

 

itoa is the integer into a string

int itoa(int value,char *string,int radix);

is an integer value to be converted, s

tring string is used to store the conversion result, radix conversion time is hexadecimal.

int i = 56;
char str_int[10];
itoa(i,str_int,10);
lr_out_message("%s",str_int);

 

Guess you like

Origin www.cnblogs.com/lvchengda/p/12626469.html