1What is strcpy() function in C++?
2
3It is a part of <cstring> header file in c++.
4strcpy() is a standard library function in C/C++ and is used to copy one string
5to another. In C it is present in string. h header file and in C++ it is
6present in cstring header file.
1//When to use strcpy_s:
2// Use strcpy_s to copy a const char[] array in read and write memory
3//How to use strcpy_s:
4
5//The location where the array is going to be copied to
6char* ptrToArray = new char[sizeof(testArray)]
7
8//The Array that gets copied To ptrToArray;
9const char[] testArray = "Test Array";
10
11strcpy_s(ptrToArray, sizeof(testArray), testArray);
12
13//Modify the copied array
14testArray[i] = 'A'
15