sprintf is it safe to use?

1 view (last 30 days)
Daniel Martelli
Daniel Martelli on 3 Sep 2020
Answered: Bruno Luong on 3 Sep 2020
Is it safe to use the code sprintf? because i was reading something and it said that sprintf is not safe to use
  4 Comments
KSSV
KSSV on 3 Sep 2020
Share the link where there was a warning.
per isakson
per isakson on 3 Sep 2020
"sprintf is not safe to use" in what programming language?

Sign in to comment.

Accepted Answer

Bruno Luong
Bruno Luong on 3 Sep 2020
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.

More Answers (0)

Categories

Find more on Entering Commands in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!