Why My C code got this fucking warning!


  • -4
    L

    struct TreeNode* invertTree(struct TreeNode* root) {

    if(!root)
    
        return NULL;
    
    struct TreeNode *left=root->left;
    
    root->left=invertTree(root->right);
    
    root->right=inverTree(left);
    
    return root; 
    

    }

    warning: implicit declaration of function ‘inverTree’ [-Wimplicit-function-declaration]


  • 0
    I

    inverTree ???
    invertTree ???


  • 1
    R

    typo! here

    root->right=inverTree(left);
    

    lacks a 't'. name of your function is 'invertTree'


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.