mirror of
https://github.com/krahets/hello-algo.git
synced 2026-02-12 15:15:48 +08:00
fix: Update C code for compatibility with the MSVC compiler (#949)
* Replace VLA with malloc Replace VLA with malloc to make C code compatible with cl compiler on Windows. * Fix C code for CI compiler. * Fix C code compability to CI. * check the trigger
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
vector<TreeNode *> res;
|
||||
|
||||
/* 前序遍历:例题一 */
|
||||
static void preOrder(TreeNode *root) {
|
||||
void preOrder(TreeNode *root) {
|
||||
if (root == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ vector<TreeNode *> path;
|
||||
vector<vector<TreeNode *>> res;
|
||||
|
||||
/* 前序遍历:例题二 */
|
||||
static void preOrder(TreeNode *root) {
|
||||
void preOrder(TreeNode *root) {
|
||||
if (root == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user