반응형
#include <stdio.h>
int main() {
int arr[5] = {0, };
for(int i = 0; i < 5; i++) {
printf("%d ", arr[i]);
}
}
/*
Output : 0 0 0 0 0 0
*/
#include <stdio.h>
int main() {
int arr[5] = {1, 2};
for(int i = 0; i < 5; i++) {
printf("%d ", arr[i]);
}
}
/*
Output : 1 2 0 0 0 0
*/
#include <stdio.h>
int main() {
int arr[5] = {1, 2, };
for(int i = 0; i < 5; i++) {
printf("%d ", arr[i]);
}
}
/*
Output : 1 2 0 0 0 0
*/
#include <stdio.h>
int main() {
int arr[5] = {-1, };
for(int i = 0; i < 5; i++) {
printf("%d ", arr[i]);
}
}
/*
Output : -1 0 0 0 0 0
*/
반응형
'[알아두면 좋을 것들]' 카테고리의 다른 글
맥 OBS 화면녹화 오디오 캡쳐 (0) | 2022.03.19 |
---|---|
노션 방문자 수 / 투데이 측정 (0) | 2021.08.09 |
Memset 주의 (0) | 2021.03.07 |
C언어 scanf / fgets (0) | 2021.03.06 |
C언어에서 헷갈릴 수 있는 char 배열 관련 정보 (0) | 2021.03.05 |