Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
vyměna proměnych pomoci parametru
//clang 6.0.0 #include <stdio.h> void vymen(int *aPtr1, int *aPtr2); int main(void) { int a = 10; int b = 20; //int *pa = &a; //int *pb = &b; int *pa; int *pb; pa = &a; pb = &b; printf("&a=%p &b=%p\n", &a, &b); printf("pa=%p pb=%p\n", pa, pb); printf("Pred vymenou: a=%d b=%d\n", a, b); vymen(pa, pb); //vymen(&a, &b); printf("Po vymene: a=%d b=%d\n", a, b); return 0; } void vymen(int *aPtr1, int *aPtr2) { printf("aPtr1=%p aPtr2=%p\n", aPtr1, aPtr2); int tmp = *aPtr1; *aPtr1 = *aPtr2; *aPtr2 = tmp; return; }
run
|
edit
|
history
|
help
0
Herout (67) - 6
Bucles: Rombo asimetrico
interestCalculationSample
resize.c
Recursividad: Hanoi
Numero pi Euler
Lazy dope vectors by Henry Kroll III www.thenerdshow.com
Recorrido matriz bidimensional y busqueda valor
Vectores: Llena vector con números al azar
cv3