C,C++,JAVA char,各占字节数

 
char在C和C+中占一个字节
Java中无论是汉字还是英文字母都是用Unicode编码来表示的,一个Unicode码是16位,每字节是8位,所以一个Unicode码占两字节
    /**
     * The number of bits used to represent a <tt>char</tt> value in unsigned
     * binary form.
     *
     * @since 1.5
     */
    public static final int SIZE = 16;
 
posted @ 2014-08-25 21:13  mjorcen  阅读(468)  评论(0)    收藏  举报