Pointer errors in the method of transmission(c++)

后端 未结 4 1300
一整个雨季
一整个雨季 2020-12-07 06:41

I encountered a problem.I try to change the pointer,but pointer does not change. Here is my code:

 void TestPoint(char* point)
{
point=new char[10];
}
int ma         


        
4条回答
  •  粉色の甜心
    2020-12-07 07:13

    void TestPoint(char** point)
    {
        *point = new char[10];
    }
    
    int main(int argc, char* argv[])
    {
        char* test = NULL;
        TestPoint(&test);
        /******/
        return 0;
    }
    

提交回复
热议问题