π REVIEW
int grid[3][4] = {
0, 1, 2, 3,
4, 5, 6, 7,
8, 9, 10, 11,
};
π― QUIZ
lotto λ°°μ΄μ λ€μ΄μλ μ ν¨ν κ°μ μΆλ ₯νλ ν¨μλ₯Ό λ§λμΈμ.
0 μ΄μ μ λμ¨ κ°λ€λ§ μ ν¨νλ€κ³ νλ¨ν©λλ€.
void show_lotto(int l[], int size)
{
for (int i = 0; i < size; i++)
{
if (l[i] == 0)
break;
printf("%d ", l[i]);
}
}
void show_lotto_v2(int l[])
{
int i = 0;
while(1)
{
if (l[i] == 0)
break;
printf("%d ", l[i]);
i++;
}
}
void show_lotto_v3(int *l)
{
while(*l)
{
if (*l == 0)
break;
printf("%d ", *l++);
}
}
π― QUIZ
fgets ν¨μλ₯Ό μ΄μ©ν΄μ νμΌ μ 체λ₯Ό μΆλ ₯νμΈμ.
void print_file_2()
{
FILE *fp = fopen("poem.txt", "r"); // FILE : ꡬ쑰체
char buf[256];
while(fgets(buf, sizeof(buf), fp))
{
printf("%s", buf);
}
fclose(fp);
}
μμ) λ
ν¨ν΅, νλ§κΈμ€, λ³μ ν λΉ, ν¨μ νΈμΆ

μΆμ² : by Yngie
void push(int n)
{
g_stack[g_top++] = n;
}
int pop()
{
return g_stack[--g_top];
}
int is_empty()
{
return g_top == 0;
}
: λ°°μ΄μ κ°μ νμ μ μμλ€μ λμ νλ€λ©΄, ꡬ쑰체λ λ€λ₯Έ νμ μ μμλ€μ λμ ν μ μλ€.
struct POINT
{
int x, y;
};
struct RECT{
struct POINT pt1, pt2;
};
int main()
{
struct POINT pt = {10, 20};
struct RECT rc = {
{1, 2},
{3, 4},
};
struct RECT *p=&rc;
printf("%d %d %d %d",p->pt1.x, (*p).pt1.y, (&p->pt2)->x, (&(*p).pt2)->y);
return 0;
}
λ°λλ½
-> JPA μ¬μ©νμλ λΆμ΄ λ°λλ½ μλ리μ€λ₯Ό μμ±ν΄μ ν
μ€νΈ νμ¬.. μ΄λ° λ²κ·Έ ν
μ€νΈ μ’μ~