Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
C_141210_Punteros
//Title of this code #include <stdio.h> void intercambiarValoresP(short* x, short* y); void intercambiarValoresV(short *z, short *t); int main(void) { short a, b; a = 5; b = 2; short c, d; c = 5; d = 2; intercambiarValoresP(&a, &b); printf("\n\na vale: %hd\n", a); printf("b vale: %hd\n", b); intercambiarValoresV(&c, &d); printf("\n\nc vale: %hd\n", c); printf("d vale: %hd\n", d); printf("Dirección de a: %p\n", &a); printf("Dirección de b: %p\n", &b); printf("Dirección de c: %p\n", &c); printf("Dirección de d: %p\n", &d); return 0; } void intercambiarValoresP(short* x, short* y) { short aux = *x; *x = *y; *y = aux; printf("\tDirección de x: %p\n", &x); printf("\tDirección de y: %p\n", &y); printf("\tValor de x: %p\n", x); printf("\tValor de y: %p\n", y); return; } void intercambiarValoresV(short *z, short *t) { long aux = z; z = t; t = aux; printf("\tDirección de z: %p\n", &z); printf("\tDirección de t: %p\n", &t); printf("\tValor de z: %p\n", z); printf("\tValor de t: %p\n", t); return; }
run
|
edit
|
history
|
help
0
C_141126_ArrayMayorMenor01
18BCE2182 ASSESS_1 Q2-3
Lab 10 v1
Refcount220323
exercises
First program.c
lab5!
18BCE2182 ASSESS_1 Q2-3
2
C_141113_euclides