"CL.exe"이(가) 종료되었습니다(코드: 2) 원인
2019. 7. 9. 10:43ㆍTIP
컴파일 오류일 가능성이 크다. 경고를 보고 하나씩 지워나가면 해결할 수 있다
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <queue> | |
#include <cstring> | |
#include <iostream> | |
using namespace std; | |
struct tree { | |
int p; | |
int left, right; | |
tree() : p(-1) {} | |
tree(int p, int left, int right) : p(p), left(left), right(right) {} | |
}; | |
tree tr[10001]; | |
int coldata[10001]; | |
int col = 1; | |
int main(void) { | |
ios_base::sync_with_stdio(false); | |
cin.tie(nullptr); | |
int n; | |
cin >> n; | |
for (int i = 1; i <= n; i++) { | |
int p, l, r; | |
tr[p].left = l, tr[p].right = r; // CL.exe | |
tr[l].p = p, tr[r].p = p; | |
} | |
int root; | |
for (int i = 1; i <= n; i++) { | |
if (tr[i].p == -1) { | |
root = i; | |
} | |
} | |
cout << root << '\n'; | |
return 0; | |
} |
예를 들어 초기화하지 않은 변수를 넣었을 때 이러한 오류가 생긴다
'TIP' 카테고리의 다른 글
추후 구매할 개발용 노트북 1순위 (0) | 2019.09.12 |
---|---|
윈도우에서의 노트북 모델명 확인 (0) | 2019.08.20 |
마크다운 문법 (0) | 2019.07.05 |
visual studio 초록색 경고줄 제거 (0) | 2019.06.27 |
엑셀 지속적으로 바뀌는 랜덤함수로 정렬 불가할 때 (0) | 2019.05.22 |