Skip to content

Instantly share code, notes, and snippets.

View aledruetta's full-sized avatar
🏠
Working from home

Alejandro Druetta aledruetta

🏠
Working from home
View GitHub Profile
.arch armv6
.eabi_attribute 28, 1
.eabi_attribute 20, 1
.eabi_attribute 21, 1
.eabi_attribute 23, 3
.eabi_attribute 24, 1
.eabi_attribute 25, 1
.eabi_attribute 26, 2
.eabi_attribute 30, 6
.eabi_attribute 34, 1
// file: hello.c
#include <stdio.h>
int main() {
printf("Hello World!");
return 0;
}
void foo ( Lista *p ) {
// modifica p
}
int main () {
Lista a;
// passa "a" como referência
foo ( &a );
return 0;
void foo ( Lista p ) {
// modifica p
}
int main () {
Lista a;
// passa "a" como valor
foo ( a );
return 0;
double tempo = 0.0;
// declara e inicializa
double *ptr = &tempo;
// valor
printf ("%p\n", ptr);
// Saída: 0xff53...
// endereço
Lista adicionar (Lista lst, Registro reg) { ... }
Lista nova = adicionar (lista, registro);
int num = 7;
printf ("Endereço de num: %p\n", &num);
/* Saída:
Endereço de num: 0x7ffee3733b3c
*/
bool adicionar (Lista *lst, Registro reg) { ... }
Lista lista;
Registro registro;
registro.chave = 31;
adicionar (lista, registro);
typedef struct
{
int chave;
// outros membros
} Registro;
// aqui o asterisco significa:
// "isso aqui é um ponteiro"
int *ptr = &num;
// aqui significa: "pega o valor
// que está neste endereço"
int x = *ptr;