Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

373
Visualizações
What are pointers in C?

In short, they are variables that contain the memory address of another variable, that is, they refer to the memory location of the other variable. This ensures us to quickly access the stored information.

For example:

 address = 0, 1, 2, 3, 4, 5 variable = a, b, c, d, e, f value = ?, ?, 4, 9, ?, 5

We see that the variable "d" is at memory address 3 and that its value is "9".

To access its value very quickly, you just have to create a pointer to that memory address.

 int d = 9; int *p = &d printf("Address of 'd': %p\n", &d); result: Addres of 'd': 3 printf("Value of 'p': %p\n", p); result: Value of 'p': 9

this would indicate that "*p" is pointing to the memory address of the variable "d" so you can access its value faster.

If we want to access a memory location (X) to change its value, it would be something like:

 struct point { int x; int y; }; struct point my_point = { 3, 7 }; struct point *p = &my_point; printf("%p", p); result: {3, 4} p->x = 5; p->y = 6; printf("%p", p); result: {5, 6}

Or you can also assign a new value like this (*p).y = 5

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda