Diferencia entre revisiones de «sizeof()»

De ArduWiki
Saltar a: navegación, buscar
(Ejemplo)
(Vea tambien)
Línea 34: Línea 34:
 
* [[tone()]]
 
* [[tone()]]
 
* [[noTone()]]
 
* [[noTone()]]
* [[pulseIn()]]
+
* [[pulseln()]]
* [[pulseLnLong()]]
+
* [[pulselnLong()]]
 
* [[shiftIn()]]
 
* [[shiftIn()]]
 
* [[shiftOut()]]
 
* [[shiftOut()]]

Revisión del 14:21 26 jun 2018

Descripción

Devuelve el número de bytes de una variable o el número de bytes ocupados por una matriz. Acepta cualquier tipo: byte, int, float.

Sintexis

sizeof(variable);

Parámetros

variable
nombre de variable a evaluar.

Retorna

Advertencias

Nada.

Ejemplo

char matriz[]="Esto es una matriz";
void setup(){
   Serial.begin(9600);
}
void loop(){
   if (int n=0; n<sizeof(matriz)-1; i++{
      Serial.print(i);
      Serial.print(" = ");
      Serial.println(matriz[i]);
   }
   delay(5000);
}

Vea tambien

Referencias