If the character string "ab56cd87" is input, the output result is: decimal integer 5687 is output in %d format; If the string "-ab56cd87" is input, the output result: decimal integer -5687 is output in %d format.
Extended data:
Efficient C language programming skills;
One: Exchange space for time.
The biggest contradiction of computer programs is the contradiction between space and time. Therefore, from this perspective, we should consider the efficiency of the program through reverse thinking.
Two: mathematical methods to solve problems?
Mathematics is the mother of computers. Without the foundation of mathematics, there would be no development of computers. Therefore, when writing a program, using some mathematical methods will improve the execution efficiency of the program by an order of magnitude.
Three: using bit operation
The third trick to realize efficient C language writing-reducing division and modulo operations with bit operations.
In a computer program, the bit of data is the smallest data unit that can be operated. Theoretically, all operations and operations can be completed by "bit operation". General bit operation is used to control hardware or do data conversion, but flexible bit operation can effectively improve the efficiency of program operation.
Baidu encyclopedia -C language