This is the Unix/Linux strdup() function, right? It's a C function (but not a C Standard Library function.) Since C strings are char arrays, and since C does not allow assigning arrays, passing arrays by value to a function or returning them as a function result, any passing of arrays to or from a function must be done with pointers.
C++, built on top of the C data model, has the same restrictions.
Furthermore, since strdup() allocates memory for the duplicated string dynamically, you must call free() on that pointer when done, to avoid a memory leak.
So, the right way is:
.... char *p1 = strdup(p);
.... [use p1 for something]
.... free(p1); /* do this BEFORE p1 goes "out of scope" */
So, everything about strdup() requires pointers and not arrays.