C++ allocating dynamic memory in a function - newbie question

前端 未结 7 1607
借酒劲吻你
借酒劲吻你 2021-01-31 12:05

I\'m investigating a memory leak and from what I see, the problem looks like this:

int main(){
    char *cp = 0;
    func(cp);
    //code
    delete[] cp;
}

voi         


        
7条回答
提交回复
热议问题