How to remove secure warnings when using scanf (_CRT_SECURE_NO_WARNINGS)

less than 1 minute read

You can do it by adding a line at the beginning of the code.

#define _CRT_SECURE_NO_WARNINGS

You can also use a line below which enables selective modification of the behavior of compiler warning messages.

#pragma warning(disable: 4996)

Check out the Microsoft docs - Compiler Warning (level 3) C4996 for more info on this warning.

Categories: ,

Updated: