forked from blau_araujo/pbn
exemplos da aula 9
This commit is contained in:
parent
7c9155a262
commit
462c5488a7
3 changed files with 194 additions and 0 deletions
14
curso/exemplos/09/exemplo.c
Normal file
14
curso/exemplos/09/exemplo.c
Normal file
|
@ -0,0 +1,14 @@
|
|||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
|
||||
int a = 123;
|
||||
char *b = "123";
|
||||
int *c = (int *)b; // Casting do valor no endereço 'b' para inteiro
|
||||
|
||||
printf("Inteiro a: %d\n", a);
|
||||
printf("String b: %s\n", b);
|
||||
printf("Inteiro c: %d\n", *c); // Imprime o valor no endereço 'c'
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue