Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

147
Vistas
indexing array in function from the pointer of some element

Imagine some array

uint8_t var[5] = {1,2,3,4,5};

so var will be pointer to the first element of this array, and

uint 8_t* a=var;
b=a[3]

and

b=var[3]

will give the same result.

But will

a = &var[2];
b = a[1];

and

b=var[3];

be same?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

After this assignment

a = &var[2];

that is the same as

a = var + 2;

due to the implicit conversion of the array designator to a pointer to its first element the pointer a points to the element var[2].

So a[0] yields var[2] and a[1] yields var[3].

Pay attention to that the subscript operator a[i] is evaluated like *( a + i ).

So you have a[1] is equivalent to *( a + 1 ) that is in turn equivalent to *( var + 2 + 1 ) that is to *( var + 3 ).

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda