The error is because strncpy is declared in the cstring header file.
A pointer is used because you are working with C strings, which are char arrays. Arrays in C are used through pointers. And strncpy takes two pointers to char(char arrays) to do the copy process.