andy0013 / TP2

TP2 Hilos
0 stars 0 forks source link

No usar atoi, es una función insegura #16

Closed fedemgp closed 2 years ago

fedemgp commented 2 years ago

https://github.com/andy0013/TP2/blob/1bffc6e02134bd4ff4eae8332b10db3ccf65d17b/TP2/src/main.cpp#L25

Probá hacer atoi("hola") y ver que te retorna. ¿Está bien? En C existen funciones mas seguras, como strtoulo sscanf. En C++ tenés mejores funciones, como la que te habia pasado en el ticket https://github.com/andy0013/TP2/issues/6