c 2b 2b strcpy s

Solutions on MaxInterview for c 2b 2b strcpy s by the best coders in the world

showing results for - "c 2b 2b strcpy s"
Mirko
16 Jun 2017
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