Skip to content

bool 배열에 int 값을 넣을 때, invalid access 문제 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jinbeomdev opened this issue Mar 16, 2019 · 0 comments
Open

bool 배열에 int 값을 넣을 때, invalid access 문제 #1

jinbeomdev opened this issue Mar 16, 2019 · 0 comments

Comments

@jinbeomdev
Copy link
Owner

bool map[20][20];

(중간 생략)

int main() {
	scanf("%d", &T);
	for (int tc = 1; tc <= T; tc++) {
		scanf("%d%d", &N, &M);
		for (int i = 0; i < N; i++) {
			for (int j = 0; j < N; j++) {
				scanf("%d", &map[i][j]);
			}
		}

위에 처럼 bool 배열에 int 값을 넣을 경우
i = 19, j = 17일 때, 즉, map[19][17]에 접근 할 경우 변수 T의 값이 변경되는 점을 확인 할 수 있었다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant