자료구조 책에서 


while ((c = getchar()) != EOF) {

if (c == '\n') continue;

if (c == 'i' || c == 'I') {

printf("data->");

scanf("%d", &n);

if (push(n) == -1)

{

printf("스택이 가득참\n");

}

}



int push(int n)

{

if (sp < MAX_SIZE) {

stack[sp] = n;

sp++;

return 0;

}

else

return -1;

}


push문을 while문 안에 안썻는데 if문안에 조건식으로 쓴게 실행되서 스택속에 저장된건가?? 알려주삼@@