// If
#define _CRT_SECURE_NO_WARNINGS
// doesn't work, put the line to the top or do
#pragma warning(disable:4996)
#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable:4996)
#define _CRT_SECURE_NO_WARNINGS
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'