My code is this:
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
const int LENGTH1 = 25;
char array_str1[LENGTH1] = "Hey guys! ";
char array_str2[] = "What's up?";
string std_str1 = "Hello everyone! ";
string std_str2 = "How's tricks?";
int main(){
strcat_s(array_str1, LENGTH1, array_str2);
std_str1 += std_str2;
cout << std_str1 << endl;
return 0;
}
When I run it, I get the error:
use of undeclared identifier 'strcat_s'
If I comment out the strcat_s
line, the rest of the code runs fine.
I'm working from a tutorial, and even if I copy-paste the working code from the tutorial, I get the same error. I'm using Visual Studio Code 1.60.0 on MacOS 10.14.16.