When I use strdup in Microsoft Visual C++, it warns me:
strdup
warning C4996: \'strdup\': The POSIX name for this item is deprecated. Instead, u
Don't know about C++.
The C Standard does not describe any function with the strdup name (though the name is reserved). To be portable, in C, you're better off replacing that with malloc, strcpy, and free.
malloc
strcpy
free