#include <stdio.h>
int main()
{
    printf("\nA Char is %lu bytes", sizeof( char ));
    printf("\nAn int is %lu bytes", sizeof( int ));
    printf("\nA short is %lu bytes", sizeof( short ));
    printf("\nA long is %lu bytes", sizeof( long ));
    printf("\nA long long is %lu bytes\n", sizeof( long long ));
    printf("\nAn unsigned Char is %lu bytes", sizeof( unsigned char ));
    printf("\nAn unsigned int is %lu bytes", sizeof( unsigned int));
    printf("\nAn unsigned short is %lu bytes", sizeof( unsigned short ));
    printf("\nAn unsigned long is %lu bytes", sizeof( unsigned long ));
    printf("\nAn unsigned long long is %lu bytes\n",sizeof( unsigned long long ));
    printf("\nfloat is %lu bytes", sizeof( float ));
    printf("\nA double is %lu bytes\n", sizeof( double ));
    printf("\nA long double is %lu bytes\n", sizeof( long double ));
return ;
}
muhuacat@muhuacat:~/bin# gcc -o c c.c 
muhuacat@muhuacat:~/bin# ./c A Char is  bytes
An int is  bytes
A short is  bytes
A long is  bytes
A long long is  bytes An unsigned Char is  bytes
An unsigned int is  bytes
An unsigned short is  bytes
An unsigned long is  bytes
An unsigned long long is  bytes float is  bytes
A double is  bytes A long double is  bytes

c All kinds of... In language sizeof More about the length of the article

  1. C Different types of loops in language (Different types of loops in C)

    C There are three types of loops in language :for,while,do-while. while Loop first judge the condition of the loop . while (condition) { //gets executed after condition ...

  2. C++ Types in language ( Two )

    -- Classification is the most effective way to simplify things . C++ The powerful power of the language is reflected in the support of programmer's custom data type .C++ One of the main design goals of the language is to make the data type defined by the programmer as easy to use as the built-in type . One . Custom data types Data class ...

  3. C++ Types in language ( One )

    -- Classification is the most effective way to simplify things . The type is C++ The basis of language , The object type determines what operations can be performed on that object . One . Basic built-in data types C++ The basic pre-defined built-in data type is the atom that constructs everything in the world , Data types tell us what data means ...

  4. About JAVA in String The maximum length of the type

    I saw an interview question the other day , The title is easy to understand :String What's the length limit for ? For this subject , After browsing the answers of netizens , Probably got 3 There are three levels of answers . The shallowest level : Approximate the length of computer memory size . This is the simplest answer as a programmer ...

  5. C Different types of data conversion rules in languages

    Mixed operation and type conversion between different types of data 1. Automatic type conversion stay C In language , Automatic type conversion follows the following rules : ① If the type of computation involved is different , First convert to the same type , And then you do the math ② The conversion proceeds in the direction of increasing data length , To ensure that the accuracy does not drop ...

  6. php Type judgment in weakly typed languages

    1.php When a number and a string are compared or calculated ,PHP Will convert the string to a number and then compare .PHP The rule of transformation is : If a string starts with a number , Take the beginning number as the conversion result , If not, output 0. for example :123abc After the transformation ...

  7. Go Methods in language , Interfaces and embedded types

    https://studygolang.com/articles/1113 summary stay Go In language , What happens if a structure and an embedded field implement the same interface at the same time ? Let's guess , There may be two problems : The compiler will ...

  8. 【 turn 】C A detailed explanation of the cast between pointers of different structure types in a language

    C Pointers to different types of structs in a language can be cast , Very free , It's also dangerous . As long as we understand its internal mechanism , You'll find that C It's very flexible . One . Structure states how memory is distributed ,  The struct pointer declares the first address of the struct ,  A struct member declares that the member is in the ...

  9. Structure , Common body , Enumeration type sizeof

    1) Enumeration class enum Type space computing enum It just defines a set of constants , There's no “ Elements ”, The enumeration type is used as int To store the , So enumeration of types sizeof Values are 4 enum color(red,pink,white, ...

Random recommendation

  1. [Head First Design patterns ] Object oriented 3 features 5 principle

    Series articles [Head First Design patterns ] The design pattern of Shanxi noodle shop —— Decorator mode [Head First Design patterns ] The design pattern of Shanxi noodle shop —— Observer mode [Head First Design patterns ] The design pattern of Shanxi noodle shop — ...

  2. About a and b The problem of exchanging values without a third variable

    Today in Rupeng ( It's not advertising ) I saw a question on the paper , It's very difficult to leave out the topic , But the topic of the teacher's suggestion interests me , It's the content of the title . The topic is to put a And b Do XOR comparisons so that you don't exchange through a third variable a and b The answer is this : a=a^ ...

  3. Eclipse Next opennms Development environment construction

    1.eclipse3.5 Or later , And use pure java edition . Download address :Eclipse for Java Developers. 2. Install the required plug-ins . adopt Help/Install New Softwa ...

  4. from Ubuntu12.04 Upgrade to Ubuntu 14.04 after , The system will not start

    Get into Ubuntu Boot interface . There are usually several options ,Ubuntu,Ubuntu advanced ... Input e key , Get into grub Setting interface of . The inside ro Change to rw Can . The above can start , Temporary settings But to keep this setting forever , ...

  5. JMeter Performance testing , Complete introduction

    1. Jmeter brief introduction Apache JMeter It's a pure java Write load function test and performance test open source tool software . comparison Loadrunner for ,JMeter Small, light and free , It's becoming more and more popular and has become a mainstream performance testing tool ...

  6. Echarts A few common figures

    Recently, the company's business demand , Ask for some charts , We choose the one that is easy to use in the technical framework Echarts. Here is the effect : Here is the specific code : <!DOCTYPE html> <html> <h ...

  7. recursive - Leetcode 110 Determine whether a binary tree is a balanced binary tree

    110. Balanced Binary Tree Given a binary tree, determine if it is height-balanced. For this problem, ...

  8. BZOJ2768 JLOI2012 Champion survey ( Minimum cut )

    It's easy to think of network flow . Split everyone into 0 and 1 Two points . If someone is worth 0 Let yuan Lianxiang 0, Otherwise, let 1 Lianxianghui , Flow is 1. Between people who know each other 01 Each side is connected . Run the minimum cut . #include<iostream> #in ...

  9. Luogu P1457 castle The Castle Problem solving report

    P1457 castle The Castle Title Description We are honest USACO The protagonist is farmer John (Farmer John) With unimaginable luck , He received a special gift on his birthday : a sheet " Lucky Ireland " ...

  10. APP The red dot reminds us of three stages

    The following page is where we go to APP After the main interface . The number on the red dot of the customer option shows the total number of customers we didn't view .   When we switch to the customer fragment when , The number of loan customers and insurance customers will be displayed .   When we click into one ...