I've been getting this C4996 error in visual studio as a result of using the scanf()
function.
It turned out that the solution to this problem is adding the line _CRT_SECURE_NO_WARNINGS
to Configuration Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions -> Edit.
It fixed the problem perfectly, but I could not find a proper explanation of the actual meaning of this thing. If it disables warnings, why did my program crash at first place? What is "CRT"?
An example of a crashing program:
#include <stdio.h>
main()
{
int number;
printf("enter a number\n");
scanf("%d", &number);
}