xxxxxxxxxx
// put me in your main cpp file
#define _CRT_SECURE_NO_WARNINGS
// NOTE: I am using Visual Studio 2022. I am not sure if this code works with all IDEs or not.
xxxxxxxxxx
// If
#define _CRT_SECURE_NO_WARNINGS
// doesn't work, put the line to the top or do
#pragma warning(disable:4996)
xxxxxxxxxx
in vs2022
go to the project settings
then c/c++
then preprocessor
then click on the arrow at the end of the line with the name "preprocessor definitions"
then add the '_CRT_SECURE_NO_WARNINGS'