Diferencia entre revisiones de «atof()»

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

Revisión del 18:52 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