Is it safe to use the code sprintf? because i was reading something and it said that sprintf is not safe to use

4 个评论

Where you want to use? And where you read it is not safe and why?
I havent used it, i just went to google and wrote sprintf just to see what it does, and i came across this warning, so i figured i should ask. So can you answer my question and say if it is safe to use please
Share the link where there was a warning.
"sprintf is not safe to use" in what programming language?

请先登录,再进行评论。

 采纳的回答

Bruno Luong
Bruno Luong 2020-9-3

1 个投票

It's not safe for C where strings are 0 terminated.
But for MATLAB the length is inside an internal (mxArray) structure, so it's totally safe.

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Entering Commands 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by