#define __STDC_WANT_LIB_EXT1__ 1
#define __STDC_LIB_EXT1__ 1
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
int main() {
// Write C code here
printf("Hello world");
char* key="";
char* key1="";
char curr[5] = "abcd";
strncpy_s(key, 68, curr,67);
strncpy_s(key1, strlen(curr), curr,strlen(curr));
printf("%s \n%s",key,key1 );
return 0;
}
I tried online compilers https://www.tutorialspoint.com/compile_cpp11_online.php https://www.programiz.com/c-programming/online-compiler/
I tried g++ abc.cpp -std=c++11
still getting
abc.cpp:13:31: error: ‘strncpy_s’ was not declared in this scope
strncpy_s(key, 68, curr,67);