Difference between printf and printf_s in C? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Difference between printf and printf_s in C?

And which among them is more secure to use ?

24th Jan 2021, 6:54 AM
Tajamul Bashir Najar
Tajamul Bashir Najar - avatar
1 Answer
+ 1
Simple answer: printf_s (as any _s function) is the advanced security version of printf. It checks (during runtime) if the parameters (the format string) are valid and calls an handler if not
24th Jan 2021, 7:13 AM
Angelo
Angelo - avatar