[TOC]
一、數字10在內存的存儲形式
一個字節8位,一位是1或者0
8位最高數是:255
1+2+4+8+16+32+64+128 = 255
10
二、數組和指針
#include <stdio.h>
int main(void)
{
int powers[8] = {1, 2, 3, 4, 5};
//輸出數組powers[1]的值
printf("%d\n",powers[1]);
//輸出數組powers的指針
printf("%p\n",powers);
//輸出數組powers的指針+1的值
printf("%d\n",*(powers+1));
}
二維數組:
int zippo[4][2] = {
{2, 4},
{6, 8},
{1, 3},
{5, 7}
};
2.png
三、字符串
字符串是以空字符(\o)結尾的char數組。
//下面兩種方式都是可以的
char heart[] = "I love Tillie!";
char *head = "I love millie!";