๐ฏ ๋ฐฐ์ด: ๊ฐ์ ๋ฐ์ดํฐ ํ์ ์ด ์ฌ๋ฌ๊ฐ ๋ชจ์ธ ๊ฒ
๋ฐ์ดํฐํ์ ๋ณ์๋ช [์ํ๋๊ฐฏ์];
int a,b,c,d,e // ๋ถํธ... int alist[5] // ํธ์...
๐ฏ ๋ฐฐ์ด ์ ์ธ ๋ฐ ์ด๊ธฐํ: int alist[5]={1,2,3,4,5}
int alist[] = {1,2,3,4,5,6,7,8,9} ์์์ ๊ฐ์ ์๋ํ์ !
alist[index]๋ก ๋ค์ํ ์ฐ์ฐ ๊ฐ๋ฅ
alist[0] = alist[4] // ๋์
์ฐ์ฐ
alist[2] += alist[4] // ๋์
์ฐ์ฐ
int alist[5] = {0};
int blist[5] = {1};
//alist = blist (โ)
for(int i=0;i<5;i++){
alist[i] = blist[i]
}
๐ฏ ์ต๋๊ฐ๊ณผ ์ต์๊ฐ์ ๊ตฌํ๋ ์๊ณ ๋ฆฌ์ฆ
int alist[5] ={5,3,2,4,1}
์ต๋๊ฐ ์ถ๋ ฅํ๋ ์๊ณ ๋ฆฌ์ฆ ใฑ
๐ฏ ๋ฌธ์์ด์ ์ค์ฒด๋ charํ ๋ฐฐ์ด ๊ทธ๋ฆฌ๊ณ ๋์ '\0'(=null)
char hello[6] = { 'h','e','l','l','o' };
char hello1[6] = {"hello"}
char test[32] = {};
int length = 0;
printf("input:");
gets_s(test);
while (test[length] != '\0') length++;
printf("your name is %s (%d).\n", test, length);
๐ฏ ๋ฐ์ดํฐํ์ ๋ฐฐ์ด์ด๋ฆ [][][]....
int aList[3][4] = {
{1,2,3,4},
{1,2,3,4},
{1,2,3,4},
};
int bList[3][4] = {0};
int count=0;
for(int i=0;i<3;i++){
for(int j=0;j<4;j++){
aList[i][j] = count++;
}
}