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

4 commentaires

KSSV
KSSV le 3 Sep 2020
Where you want to use? And where you read it is not safe and why?
Daniel Martelli
Daniel Martelli le 3 Sep 2020
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
KSSV
KSSV le 3 Sep 2020
Share the link where there was a warning.
per isakson
per isakson le 3 Sep 2020
"sprintf is not safe to use" in what programming language?

Connectez-vous pour commenter.

 Réponse acceptée

Bruno Luong
Bruno Luong le 3 Sep 2020

1 vote

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.

Plus de réponses (0)

Catégories

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by