I downloaded MinGW-64 and ran this little snippet of code (shortened as it was originally a stack, queue and other DS implementations):
#include <iostream>
#include <cstdio>
int main()
{
const int _sizeS = 20;
.
.
.
int _tmp;
printf_s("\nEnter an alpha-numeric character to quit: ");
std::cin >> _tmp;
return 0;
}
This compiles perfectly in VS2019, and does what I want it to.
However, I use g++ pyrmd.cpp
at the command line and get an error:
pyrmd.cpp: In function 'int main()':
pyrmd.cpp:6:2: error: 'printf_s' was not declared in this scope; did you mean 'printf'?
6 | printf_s("\n Enter a character: \n");
| ^~~~~~~~
| printf
Does anyone have a clue as to why this is happening, and how to resolve it?