Ô´Â룺
# include <stdio.h>
int main()
{
/* Óгߴç */
/* һάÕûÐÎÊý×é³õʼ»¯ */
int array1[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
/* һά×Ö·ûÐÍÊý×é³õʼ»¯£¬×îºóÒ»¸öÔªËØ×Ô¶¯Ìí¼ÓΪ‘/0’ */
char array2[13] = "How are you!"; /* ·½Ê½Ò» */
char array3[13] = {'H','o','w',' ','a','r','e',' ','y','o','u','!'}; /* ·½Ê½¶þ */
/* ¶þάÕûÐÎÊý×é³õʼ»¯ */
int array4[4][4] =
{
12, 18, 6, 25,
23, 10, 32, 16,
25, 63, 1, 63,
0, 0, 27, 98
}; /* ¾ØÕóµÄÐÎʽ */
/* Î޳ߴç */
/* һά×Ö·ûÐÍÊý×é³õʼ»¯ */
char array5[] = "How are you!";
int array6[][2] = {
{ 1,50},
{45, 2},
{ 2, 0},
{12,32},
{42,33},
{15,18}
};
return 0;
}
ÔÚCÓïÑÔÖУ¬½á¹¹ÊÇÒ»ÖÖ¸´ºÏÊý¾ÝÀàÐÍ£¬Æä¹¹³ÉÔªËؼȿÉÒÔÊÇ»ù±¾Êý¾ÝÀàÐÍ£¨Èçint¡¢long¡¢floatµÈ£©µÄ±äÁ¿£¬Ò²¿ÉÒÔÊÇһЩ¸´ºÏÊý¾ÝÀàÐÍ£¨ÈçÊý×é¡¢½á¹¹¡¢ÁªºÏµÈ£©µÄÊý¾Ýµ¥Ôª¡£ÔڽṹÖУ¬±àÒëÆ÷Ϊ½á¹¹µÄÿ¸ö³ÉÔ±°´Æä×ÔÈ»¶Ô½ç£¨alignment£©Ìõ¼þ·ÖÅä¿Õ¼ä¡£¸÷¸ö³ÉÔ±°´ÕÕËüÃDZ»ÉùÃ÷µÄ˳ÐòÔÚÄÚ´æÖÐ˳Ðò´ ......