Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - C language uses strings to add integers.
C language uses strings to add integers.
You can write two small functions to solve this problem. One is the atoi () function, which converts a string into an int type, and the other is itoa (), which converts a number of an int type into a string. At first, str 1 and str2 are converted into integers with atoi (), and then added, and then the added result is converted into a string with the function of itoa (), and then assigned to the result. This is an idea, and those two functions are not too difficult. Try to realize them yourself.