[Study Notes] [C Language] type specifier, Study Notes C Language

Source: Internet
Author: User

[Study Notes] [C Language] type specifier, Study Notes C Language
1. short and long

3. Code

 

1 # include <stdio. h> 2/* 3 int 4 bytes % d 4 short 2 bytes % d 5 long 8 bytes % ld 6 long 8 bytes % lld 7 8 9 signed10 unsigned % u11 */12 int main () 13 {14 // 0000 0000 0000 0000 0000 0000 0000 000015 // The 31 power of 2-116 // The 32 power of 2-117 int num; 18 19/* 20 what is the difference between signed and unsigned: the highest bit of 21 signed should be regarded as the highest bit of 22 unsigned, not as the highest bit of 23 */24 // signed = signed int25 // signed: positive, 0, negative 26 signed int a = 10; 27 signed a2 = 10; 28 29 // unsigned int = unsigned30 // unsigned: 0, positive 31 unsigned int B = 10; 32 unsigned b2 = 10; 33 34 long unsigned int c = 34343; 35 long unsigned c2 = 423432; 36 37 short unsigned int d = 4343; 38 short unsigned d2 = 43243; 39 40 short signed int e = 54354; 41 short signed e2 = 434; 42 43 45 46 return 0; 47} 48 49 void longAndShort () 50 {51 // long = long int52 long int a = 100645654654645645l; 53 long a2 = 100645654654645645l; 54 55 // long int = long long56 long int c = 100645654654645645ll; 57 long c2 = 1095435435435ll; 58 59 // short = short int60 short int d = 5454; 61 short d2 = 43434; 62 63 // printf ("% lld \ n", c); 64 65 int s = sizeof (long int ); 66 printf ("% d \ n", s); 67}

 

Related Article

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.