Diferencia entre revisiones de «atof()»

De ArduWiki
Saltar a: navegación, buscar
(Referencias)
(Vea también)
Línea 31: Línea 31:
  
 
== Vea también ==
 
== Vea también ==
 +
<categorytree mode=all>Funciones conversion</categorytree>
 
* [[string]]
 
* [[string]]
* [[atoi()]]
 
* [[atol()]]
 
 
* [[strtoul()]]
 
* [[strtoul()]]
  

Revisión del 18:51 24 jun 2019

Descripción

Convertir un string a float.

Sintaxis

atof(matriz);

Parametros

matriz
nombre de la matriz tipo char

Retorno

Numero tipo float.

Advertencias

Nada.

Ejemplo 1

void setup(){
   Serial.begin(115200);
   char texto[] = "-123.45";
   float x = atof(texto);
   Serial.println(x, 3);  //-123.450
}
 
void loop(){
   //Nada
}

Vea también

Referencias