English  

كتب scrolling with cursors

اذا لم تجد ما تبحث عنه يمكنك استخدام كلمات أكثر دقة.

عرض المزيد

التمرير باستخدام المؤشرات (معلومة)


يُمكن استخدام المؤشرات لتمرير المتغيرات باستخدام مراجع لها، بما يسمح لقيمتها بأن تتغير، على سبيل المثال انظر إلى كود لغة C++ التالي:

/* a copy of the int n is changed */ void not_alter(int n) { n = 360; } /* the actual variable passed (by address) is changed */ void alter(int *n) { *n = 120; } void func(void) { int x = 24; /*pass x's address as the argument*/ alter(&x); /* x now equal to 120 */ not_alter(x); /* x still equal to 120 */ }

المصدر: wikipedia.org