Skip to content

구현시 TIP들.. by 권현준... #4

Description

@HyunJunKwon

[C style의 2차 배열 동적 할당/해제]
-> 해제에서의 free문에 주목!

int ** a;

a = (int **)malloc(sizeof(int *) * N);
for(i < N) a[i] = (int *)malloc(sizeof(int) * M);

free(i < N) free(a[i]);
free(a);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions