Skip to content

2차원 Array 1차원으로 indexing #50

@devLupin

Description

@devLupin
  • 행번호 * 열의 개수 * 열번호 로 2차원 배열처럼 indexing 할 수 있다.

  • example

int arr[16];

// 2*8의 크기를 가졌다고 가정
for(int i=0; i<2; i++) {
  for(int j=0; j<8; j++)
    cout << arr[i * 8 + j];
  cout << '\n';
}

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