Data Type Definition of the Keil MDK Compiler

Source: Internet
Author: User
1 # include "usart. H "2 int main () 3 {4 usartmediaconfig (); // serial port initialization, the following information is printed through the serial port 5 printf (" char: % d \ r \ n ", sizeof (char); 6 printf ("unsigned char: % d \ r \ n", sizeof (unsigned char); 7 printf ("short: % d \ r \ n ", sizeof (short); 8 printf (" unsigned short: % d \ r \ n ", sizeof (unsigned short )); 9 printf ("int: % d \ r \ n", sizeof (INT); 10 printf ("unsigned INT: % d \ r \ n ", sizeof (unsigned INT); 11 printf ("LONG: % d \ r \ n", sizeof (long); 12 printf ("unsigned long: % d \ r \ n ", sizeof (unsigned long); 13 printf (" float: % d \ r \ n ", sizeof (float )); 14 printf ("Double: % d \ r \ n", sizeof (double); 15 while (1); 16}

The preceding Code defines the length of common data types in the Keil MDK compiler.

The result is as follows:

CHAR: 1
Unsigned char: 1
Short: 2
Unsigned short: 2
INT: 4
Unsigned INT: 4
Long: 4
Unsigned long: 4
Float: 4
Double: 8



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.