scanf vs scanf_s

  • Thread starter Thread starter Jeff0803
  • Start date Start date
J

Jeff0803

Guest
I have an error from scanf.

error C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead.

int a = 0, b = 0;
char op = 0;
int result = 0;

scanf("%d %c %d", &a, &op, &b);


Error disappeared after change it to scanf_s.

What is the difference between scanf and scanf_s?

Continue reading...
 
Back
Top