Skip to content

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

Open
@jinbeomdev

Description

@jinbeomdev
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의 값이 변경되는 점을 확인 할 수 있었다.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions