-3

Although my program gives the required output. There are many warnings showing scanf() shouldn't be used and try using scanf_s() instead.

Possible cause of this warning??

This is happening to all the programs which are using the scanf function. Even simple addition of numbers.

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
user3743672
  • 151
  • 5

1 Answers1

0

With scanf, with some format arguments it is possible to crash your program if you use unlimited size inputs. scanf_s requires to provide size of output buffers, thus limiting possibility of buffer overflows (provided you specify output buffer sizes correctly).

mvp
  • 111,019
  • 13
  • 122
  • 148