aboutsummaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2025-08-27 12:45:33 -0600
committerJack Sangdahl <[email protected]>2025-08-27 12:45:33 -0600
commit4552bcf5a4a356415e248dee3b201f0cea7205bb (patch)
tree9868465918c6a6841b84cd14d66923b993dd9d62 /readme.md
parentf549305fb5ca531d29dce6c2c091560f44190443 (diff)
downloadleetcode-4552bcf5a4a356415e248dee3b201f0cea7205bb.tar.gz
leetcode-4552bcf5a4a356415e248dee3b201f0cea7205bb.zip
chore: Refactor two_d_arr_init function
Return a pointer to a new struct, rather than initialise objects in an existing struct
Diffstat (limited to 'readme.md')
-rw-r--r--readme.md5
1 files changed, 2 insertions, 3 deletions
diff --git a/readme.md b/readme.md
index e94d2c7..76a3557 100644
--- a/readme.md
+++ b/readme.md
@@ -54,9 +54,8 @@ int func(int **edges, int edgesSize, int *edgesColSize);
int main() {
// edges = [[0,1],[0,2],[1,3],[1,4],[2,5],[2,6]]
int edges_input[6][2] = {{0, 1}, {0, 2}, {1, 3}, {1, 4}, {2, 5}, {2, 6}};
- struct two_d_arr edges;
- two_d_arr_init(&edges, ARRAY_SIZE(edges_input), ARRAY_SIZE(edges_input[0]), edges_input);
+ struct two_d_arr *edges = two_d_arr_init(ARRAY_SIZE(edges_input), ARRAY_SIZE(edges_input[0]), edges_input);
int res = func(edges.arr, edges.row_size, edges.col_size);
- two_d_arr_free(&edges);
+ two_d_arr_free(edges);
}
```