-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApuntadores.c
41 lines (28 loc) · 889 Bytes
/
Apuntadores.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Apuntadores.c
* Author: virgiliopadronbatun
*
* Created on 24 de julio de 2018, 14:35
*/
#include <stdio.h>
#include <stdlib.h>
/*
*
*/
/* Figura 7.4: fig07_04.c
Uso de los operadores & y * */
int main() {
int a; /* a es un entero */
int *ptrA; /* ptrA es un apuntador a un entero */ /* ptrA toma la direccion de a */
a = 7;
ptrA = &a;
printf( "La direccion de a es %p" " \nEl valor de ptrA es %p", &a, ptrA );
printf( "\n\nEl valor de a es %d" "\nEl valor de *ptrA es %d", a, *ptrA );
printf( "\n\nMuestra de que * y & son complementos " "uno del otro\n&*ptrA = %p""\n*&ptrA = %p\n", &*ptrA, *&ptrA );
return 0;
}