※ 引述《qxxrbull (qxxrbull)》之銘言:
: 好像vs他們說printf_s比較不會有被什麼非法存取的樣子
首先得要知道printf的f是format,用途是格式化輸出
然後這兩者的差別會比較好解釋
先看MSDN(http://tinyurl.com/y4635ufz)
The main difference between printf_s and printf is that printf_s checks the
format string for valid formatting characters, whereas printf only checks if
the format string is a null pointer.
簡單來說printf只檢查了字串是不是null
而printf_s會檢查後面parameter跟字串內容有沒有合法
大guy是john