Ponteiros em C

felipes1474
Mind Map by , created over 6 years ago

Mind Map on Ponteiros em C, created by felipes1474 on 07/15/2013.

52
1
0
Tags No tags specified
felipes1474
Created by felipes1474 over 6 years ago
Unit 1 Cells, exchange and transport (F211) - cells
Jenni
National 5 Biology: Cell Biology
Mhairi McCann
regular preterite tense conjugation -ar verbs
Pamela Dentler
Narrative/Short Story Writing
Pak Sam
Family in the park
Eleuterio Caicedo Valencia
Fractions and percentages
Bob Read
situation ethics
96arthur.g
Language techniques: Macbeth
arnya_lewis
B7: Further Biology
Matthew Law
River Landscapes
Chima Power
Ponteiros em C
1 Declaração do ponteiro: int *p; Endereço de uma variável: p = &c;
1.1 p "aponta" para c
2 Operações
2.1 *ip = *ip + 10;
2.2 y = *ip + 1;
2.3 ++*ip; (*ip)++;
3 Ponteiros para Arrays
3.1 int *pa; pa = &a[0];

Annotations:

  • pa to point to element zero of a; that is, pa contains the address of a[0].
3.1.1 pa = pa + 1;

Annotations:

  • If pa points to a particular element of an array, then by definition pa+1 points to the next element, pa+i points i elements after pa, and pa-i points i elements before. Thus, if pa points to a[0],
3.2 Códigos com mesmo significado
3.2.1 pa = &a[0]; e pa = a;
3.2.2 a[i]; e *(a + i);
3.2.3 a[i]; e pa[i];
3.2.4 a+i; e &a[i];
3.3 Atenção
3.3.1 Permitido
3.3.1.1 pa = a; e pa++;
3.3.2 Não Permitido
3.3.2.1 a = pa; e a++;
4 Ponteiros para Structs
4.1 struct node { int value; struct node *next; }
4.2 struct node { int value; struct node *left; struct node *right; }

Media attachments