Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to convert integers into strings in keil c
How to convert integers into strings in keil c
You can use sscanf, just as sprintf converts integers into string output, and vice versa (KEILC C.

Scanf and printf determine the input and output mode through the serial port of single chip microcomputer, and are generally not used in practice unless modified.

Let me give you an example:

Unsigned

tea

string[5]= { " 1234 " };

Unsigned

Internationalorganizations (same as international organizations)

n;

Sscanf (string, "%u", & ampn);

//string is a string, %u is a format control string and u is an unsigned decimal number. Is the address of the variable n.

Print function

(" %d\n ",n);

//Available from KEIL.

C

Output observation in development environment

You can put this code in KEIL.

Hello. C program to observe and verify it.