c++ uses reference to receive array of pointers

void get_vector1(char *input,char* (&argv)[具体大小] )//用引用来引用指针数组

void get_vector2(char *input,char* *argv[])//用一个指针指向指针数组
{
    //char *argv[32];
    int i = 0;
    *(argv[i++]) = strtok(input, " ");
    while (*(argv[i++]) = strtok(NULL, " "));
}


char* argv[32];

It must be noted that C++ uses references to receive pointer arrays, and the size must be added, otherwise the compiler will report an error

Guess you like

Origin blog.csdn.net/m0_74234485/article/details/132762643