What is the difference between %d and %i?

I am wondering what the difference is between %d and %i. For fprintf, they are the same. If there is no difference at all, then why do we have both of them?

 Respuesta aceptada

Image Analyst
Image Analyst el 3 de Ag. de 2017

2 votos

There appears to be no difference according to the help. My guess is they allowed both to make it easy for people coming from other programming languages where they might have used one or the other of those letters in that other language.

Más respuestas (0)

Categorías

Más información sobre Programming en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 3 de Ag. de 2017

Respondida:

el 3 de Ag. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by