call by value -> call by reference


call by value -> call by reference

포인터 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 #include <stdio.h> //전처리기 #define SIZE 3 typedef struct { //구조체 char name[10]; double w; }WEIGHT; void swap(WEIGHT *, WEIGHT *); //함수선언 int main(void) { WEIGHT man[SIZE] = { { "한성현",54.5 }, { "엄청군",125.6 }, { "갈비양",35.7 } }; int i, j; //변수 선언 for (i = 0; i<2; i++) { //제어문 for (j = i + 1; j<3; j++) { if (man[i].w>man[j].w) { swap(&man[i], &man[j]); } //call by reference } } printf("\n 이름 \t체중");...



원문링크 : call by value -> call by reference