Functions and Integer Double Pointer ================================================== In this section, you are going to learn .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow What are the calling conventions of integer double dimension array ? .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Call by Value .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Call by Reference .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Revisit Basics : :doc:`../../basic_ptr/basic_int_ptr/int_dp` .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Topics in this section, * :ref:`Integer Double Pointer : Syntax ` * :ref:`Integer Double Pointer : FAQs ` * :ref:`Integer Double Pointer : fun(expression) ` * :ref:`Rules for Call By Value ` * :ref:`Example : Call by Value : Pass Integer : dp[1][1] ` * :ref:`Example : Call by Value : Pass Integer : **dp ` * :ref:`Rules for Call By Reference ` * :ref:`Example : Call by Reference : &dp[1][1] ` * :ref:`Example : Call by Reference : dp[1] ` * :ref:`Examples of Call by Value ` * :ref:`Example 1 : Call by Value : Pass Integer : dp[0][0], dp[1][0], dp[1][1] ` * :ref:`Example 2 : Call by Value : Pass Integer : **dp, *(*(dp + 1) + 0), *(*(dp + 1) + 1) ` * :ref:`Examples of Call by Reference ` * :ref:`Example 3 : Call by Reference : Pass Single dimension arrays which are part of a double dimension array to a function ` * :ref:`Example 4 : Call by Reference : Pass Address of Double Dimension array to a function ` .. _funcs_n_ptrs_int_dp_ex_0_0: .. tab-set:: .. tab-item:: Integer Double Pointer : Syntax .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow int \*\*dp; .. _funcs_n_ptrs_int_dp_ex_0_1: .. tab-set:: .. tab-item:: Integer Double Pointer : FAQs Consider a integer double dimension array .. code-block:: c int **dp; .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Let us answer few basic questions about integer double pointer .. _funcs_n_ptrs_int_dp_ex_6: .. tab-set:: .. tab-item:: Integer Double Pointer : fun(expression) .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow If ``fun(x)`` is the function call, then ``fun(typeof(x))`` is the prototype / definition ========================== =============================== ========================================================================== Function Call Function Definition Observations ========================== =============================== ========================================================================== fun(dp[0][0]) void fun(int x) {} * Call by Value fun(dp[1][0]) void fun(int x) {} * Call by Value fun(dp[2][0]) void fun(int x) {} * Call by Value fun(&dp[0][0]) void fun(int \*p) { } * Call by Reference fun(&dp[1][0]) void fun(int \*p) { } * Call by Reference fun(&dp[2][0]) void fun(int \*p) { } * Call by Reference fun(\*\*dp) void fun(int x) {} * Call by Value fun(\*(\*(dp + 1) + 0)) void fun(int x) {} * Call by Value fun(\*(\*(dp + 2) + 0)) void fun(int x) {} * Call by Value fun(dp[0]) void fun(int \*p) { } * Call by Reference fun(dp[1]) void fun(int \*p) { } * Call by Reference fun(dp[2]) void fun(int \*p) { } * Call by Reference fun(&dp[0]) void fun(int \*\*q) { } * Call by Reference fun(\*dp) void fun(int \*p) { } * Call by Reference fun(\*(dp + 1)) void fun(int \*p) { } * Call by Reference fun(\*(dp + 2)) void fun(int \*p) { } * Call by Reference fun(dp) void fun(int \*\*q) { } * Call by Reference fun(&dp) void fun(int \*\*\*r) { } * Call by Reference ========================== =============================== ========================================================================== .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Let us understand the reason behind above prototypes ! .. _funcs_n_ptrs_int_dp_ex_8: .. tab-set:: .. tab-item:: Rules for Call By Value .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow If Declaration has two dereference operators, and * Expression has two dereference operators [] [], and * Expression does not have ``&`` * then it is call by value .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow If Declaration has two dereference operators, and * Expression has two dereference operators \* \*, and * Expression does not have ``&`` * then it is call by value .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow If Declaration has two dereference operators, and * Expression has two dereference operators \* [ ], and * Expression does not have ``&`` * then it is call by value .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Let us look at examples .. _funcs_n_ptrs_int_dp_ex_9: .. tab-set:: .. tab-item:: Example : Call by Value : Pass Integer : dp[1][1] * Step 1 : Consider a double dimension array created using a integer double pointer .. code-block:: c int **dp; dp = malloc(2 * sizeof(int *)); for (int i = 0; i < 2; i++) { dp[i] = malloc(3 * sizeof(int)); } dp[0][0] = 11; dp[0][1] = 22; dp[0][2] = 33; dp[1][0] = 44; dp[1][1] = 55; dp[1][2] = 66; .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 1 : Declaration has TWO dereference operators \* and \* * Step 2 : Consider an expression ``dp[1][1]`` .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 2 : Expression has TWO dereference operators [ ] and [ ] .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Note : ``[ ]`` and ``*`` are dereference operators .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 3 : Expression DOES NOT have ``&`` operator .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Hence ``dp[1][1]`` is Call By Value .. _funcs_n_ptrs_int_dp_ex_10: .. tab-set:: .. tab-item:: Example : Call by Value : Pass Integer : \*\*dp * Step 1 : Consider a double dimension array created using a integer double pointer .. code-block:: c int **dp; dp = malloc(2 * sizeof(int *)); for (int i = 0; i < 2; i++) { dp[i] = malloc(3 * sizeof(int)); } dp[0][0] = 11; dp[0][1] = 22; dp[0][2] = 33; dp[1][0] = 44; dp[1][1] = 55; dp[1][2] = 66; .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 1 : Declaration has TWO dereference operators [ ] and [ ] * Step 2 : Consider an expression ``**dp`` .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 2 : Expression has TWO dereference operators \* and \* .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Note : ``[ ]`` and ``*`` are dereference operators .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 3 : Expression DOES NOT have ``&`` operator .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Hence ``**dp`` is Call By Value .. _funcs_n_ptrs_int_dp_ex_11: .. tab-set:: .. tab-item:: Rules for Call By Reference .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow If Declaration has two dereference operators, and * Expression has two dereference operators [] [] or \* \* or [] \*, and * Expression has & * then it is call by reference * Example : &dp[0][0] .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow If Declaration has two dereference operators, and * Expression has one dereference operator [ ] or \* * then it is call by reference * Example : &dp[0], dp[0], \*dp .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow If Declaration has two dereference operators, and * Expression has zero dereference operators, and * then it is call by reference * Example : dp, &dp .. _funcs_n_ptrs_int_dp_ex_12: .. tab-set:: .. tab-item:: Example : Call by Reference : &dp[1][1] * Step 1 : Consider a double dimension array created using a integer double pointer .. code-block:: c int **dp; dp = malloc(2 * sizeof(int *)); for (int i = 0; i < 2; i++) { dp[i] = malloc(3 * sizeof(int)); } dp[0][0] = 11; dp[0][1] = 22; dp[0][2] = 33; dp[1][0] = 44; dp[1][1] = 55; dp[1][2] = 66; .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 1 : Declaration has TWO dereference operators [ ] and [ ] .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 2 : Expression has TWO dereference operators \* and \* .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Note : ``[ ]`` and ``*`` are dereference operators .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 3 : Expression has ``&`` operator * Step 2 : Consider an expression ``&dp[1][1]`` .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Hence ``&dp[1][1]`` is Call By Reference .. _funcs_n_ptrs_int_dp_ex_13: .. tab-set:: .. tab-item:: Example : Call by Reference : dp[1] * Step 1 : Consider a double dimension array created using a integer double pointer .. code-block:: c int **dp; dp = malloc(2 * sizeof(int *)); for (int i = 0; i < 2; i++) { dp[i] = malloc(3 * sizeof(int)); } dp[0][0] = 11; dp[0][1] = 22; dp[0][2] = 33; dp[1][0] = 44; dp[1][1] = 55; dp[1][2] = 66; .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 1 : Declaration has TWO dereference operators [ ] and [ ] * Step 2 : Consider an expression ``dp[1]`` .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 2 : Expression has ONE dereference operators .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Note : ``[ ]`` and ``*`` are dereference operators .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 3 : Expression DOES NOT have ``&`` operator .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Hence ``dp[1]`` is Call By Reference .. _funcs_n_ptrs_int_td_array_examples_call_by_value: .. tab-set:: .. tab-item:: Examples of Call by Value .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Let us look at examples of Call by Value .. _funcs_n_ptrs_int_dp_ex_15: .. tab-set:: .. tab-item:: Example 1 : Call by Value : Pass Integer : dp[0][0], dp[1][0], dp[1][1] * Step 1 : Consider a double dimension array created using a integer double pointer .. code-block:: c int **dp; dp = malloc(2 * sizeof(int *)); for (int i = 0; i < 2; i++) { dp[i] = malloc(3 * sizeof(int)); } dp[0][0] = 11; dp[0][1] = 22; dp[0][2] = 33; dp[1][0] = 44; dp[1][1] = 55; dp[1][2] = 66; * Step 2 : Pass dp[0][0], dp[1][0], dp[1][1] to a function ``fun`` .. code-block:: c fun(dp[0][0]); fun(dp[1][0]); fun(dp[1][1]); * Step 3 : Define function ``fun`` .. code-block:: c void fun(int c) { c = 99; } * Step 4 : Note that it is call by Value for below reason .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 1 : Declaration has TWO dereference operators [ ] and [ ] .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 2 : Expression has TWO dereference operators [ ] and [ ] .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 3 : Expression DOES NOT have ``&`` operator .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Means changing value of integer inside function DOES NOT affect value of integer in Caller ! * Step 5 : Free memory after use .. code-block:: c for (int i = 0; i < 2; i++) { free(dp[i]); } free(dp); * See full program below .. code-block:: c #include #include void fun(int c) { c = 99; } int main(void) { int **dp; dp = malloc(2 * sizeof(int *)); for (int i = 0; i < 2; i++) { dp[i] = malloc(3 * sizeof(int)); } dp[0][0] = 11; dp[0][1] = 22; dp[0][2] = 33; dp[1][0] = 44; dp[1][1] = 55; dp[1][2] = 66; printf("----- Before Call By Value -----\n"); printf("dp[0][0] = %d\n", dp[0][0]); printf("dp[1][0] = %d\n", dp[1][0]); printf("dp[1][1] = %d\n", dp[1][1]); fun(dp[0][0]); fun(dp[1][0]); fun(dp[1][1]); printf("----- After Call By Value -----\n"); printf("dp[0][0] = %d\n", dp[0][0]); printf("dp[1][0] = %d\n", dp[1][0]); printf("dp[1][1] = %d\n", dp[1][1]); for (int i = 0; i < 2; i++) { free(dp[i]); } free(dp); return 0; } * Output is as below .. code-block:: c ----- Before Call By Value ----- dp[0][0] = 11 dp[1][0] = 44 dp[1][1] = 55 ----- After Call By Value ----- dp[0][0] = 11 dp[1][0] = 44 dp[1][1] = 55 .. _funcs_n_ptrs_int_dp_ex_16: .. tab-set:: .. tab-item:: Example 2 : Call by Value : Pass Integer : \*\*dp, \*(\*(dp + 1) + 0), \*(\*(dp + 1) + 1) * Step 1 : Consider a double dimension array created using a integer double pointer .. code-block:: c int **dp; dp = malloc(2 * sizeof(int *)); for (int i = 0; i < 2; i++) { dp[i] = malloc(3 * sizeof(int)); } dp[0][0] = 11; dp[0][1] = 22; dp[0][2] = 33; dp[1][0] = 44; dp[1][1] = 55; dp[1][2] = 66; * Step 2 : Pass \*\*dp, \*(\*(dp + 1) + 0), \*(\*(dp + 1) + 1) to a function ``fun`` .. code-block:: c fun( **dp ); fun( *(*(dp + 1) + 0) ); fun( *(*(dp + 1) + 1) ); * Step 3 : Define function ``fun`` .. code-block:: c void fun(int c) { c = 99; } * Step 4 : Note that it is call by Value for below reason .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 1 : Declaration has TWO dereference operators [ ] and [ ] .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 2 : Expression has TWO dereference operators \* and \* .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Condition 3 : Expression DOES NOT have ``&`` operator .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Means changing value of integer inside function DOES NOT affect value of integer in Caller ! * Step 5 : Free memory after use .. code-block:: c for (int i = 0; i < 2; i++) { free(dp[i]); } free(dp); * See full program below .. code-block:: c #include #include void fun(int c) { c = 99; } int main(void) { int **dp; dp = malloc(2 * sizeof(int *)); for (int i = 0; i < 2; i++) { dp[i] = malloc(3 * sizeof(int)); } dp[0][0] = 11; dp[0][1] = 22; dp[0][2] = 33; dp[1][0] = 44; dp[1][1] = 55; dp[1][2] = 66; printf("----- Before Call By Value -----\n"); printf(" **dp = %d\n", **dp); printf(" *(*(dp + 1) + 0) = %d\n", *(*(dp + 1) + 0) ); printf(" *(*(dp + 1) + 1) = %d\n", *(*(dp + 1) + 1) ); fun( **dp ); fun( *(*(dp + 1) + 0) ); fun( *(*(dp + 1) + 1) ); printf("----- After Call By Value -----\n"); printf(" **dp = %d\n", **dp); printf(" *(*(dp + 1) + 0) = %d\n", *(*(dp + 1) + 0) ); printf(" *(*(dp + 1) + 1) = %d\n", *(*(dp + 1) + 1) ); for (int i = 0; i < 2; i++) { free(dp[i]); } free(dp); return 0; } * Output is as below .. code-block:: c ----- Before Call By Value ----- **dp = 11 *(*(dp + 1) + 0) = 44 *(*(dp + 1) + 1) = 55 ----- After Call By Value ----- **dp = 11 *(*(dp + 1) + 0) = 44 *(*(dp + 1) + 1) = 55 .. _funcs_n_ptrs_int_td_array_examples_call_by_reference: .. tab-set:: .. tab-item:: Examples of Call by Reference .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Let us look at examples of Call by Reference .. _funcs_n_ptrs_int_dp_ex_17: .. tab-set:: .. tab-item:: Example 3 : Call by Reference : Pass Single dimension arrays which are part of a double dimension array to a function * Step 1 : Consider a double dimension array created using a integer double pointer .. code-block:: c int **dp; dp = malloc(2 * sizeof(int *)); for (int i = 0; i < 2; i++) { dp[i] = malloc(3 * sizeof(int)); } dp[0][0] = 11; dp[0][1] = 22; dp[0][2] = 33; dp[1][0] = 44; dp[1][1] = 55; dp[1][2] = 66; .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow There are 2 single dimension arrays * dp[0] * dp[1] .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow dp[0] is also equal to \*dp dp[1] is also equal to \*(dp + 1) .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow dp[0] is also equal to &dp[0][0] dp[1] is also equal to &dp[1][0] * Step 2.1 : Method 1 : Pass &dp[0][0], &dp[1][0] to a function ``fun`` .. code-block:: c fun( &dp[0][0] ); fun( &dp[1][0] ); * Step 2.2 : Method 2 : Pass dp[0], dp[1] to a function ``fun`` .. code-block:: c fun( dp[0] ); fun( dp[1] ); * Step 2.3 : Method 3 : Pass \*dp, \*(dp + 1) to a function ``fun`` .. code-block:: c fun( *dp ); fun( *(dp + 1) ); * Step 3.1 : Define function ``fun`` .. code-block:: c void fun(int *ptr) { } * Step 4 : Note that it is call by Reference. Means contents of single dimension array can be changed inside function ``fun`` .. code-block:: c void fun(int *ptr) { ptr[0] = 77; ptr[1] = 88; ptr[2] = 99; } * Step 5 : Free memory after usage .. code-block:: c for (int i = 0; i < 2; i++) { free(dp[i]); } free(dp); * See full program below .. code-block:: c #include #include void fun(int *ptr) { ptr[0] = 77; ptr[1] = 88; ptr[2] = 99; } int main(void) { int **dp; dp = malloc(2 * sizeof(int *)); for (int i = 0; i < 2; i++) { dp[i] = malloc(3 * sizeof(int)); } dp[0][0] = 11; dp[0][1] = 22; dp[0][2] = 33; dp[1][0] = 44; dp[1][1] = 55; dp[1][2] = 66; printf("----- Before Call By Reference -----\n"); for (int i = 0; i < 2; i++) { for (int j = 0; j < 3; j++) { printf("dp[%d][%d] = %d\n", i, j, dp[i][j]); } } // Method 1 : Access Single dimension arrays fun( &dp[0][0] ); fun( &dp[1][0] ); // Method 2 : Access Single dimension arrays fun( dp[0] ); fun( dp[1] ); // Method 3 : Access Single dimension arrays fun( *dp ); fun( *(dp + 1) ); printf("----- After Call By Reference -----\n"); for (int i = 0; i < 2; i++) { for (int j = 0; j < 3; j++) { printf("dp[%d][%d] = %d\n", i, j, dp[i][j]); } } for (int i = 0; i < 2; i++) { free(dp[i]); } free(dp); return 0; } * Output is as below .. code-block:: c ----- Before Call By Reference ----- dp[0][0] = 11 dp[0][1] = 22 dp[0][2] = 33 dp[1][0] = 44 dp[1][1] = 55 dp[1][2] = 66 ----- After Call By Reference ----- dp[0][0] = 77 dp[0][1] = 88 dp[0][2] = 99 dp[1][0] = 77 dp[1][1] = 88 dp[1][2] = 99 .. _funcs_n_ptrs_int_dp_ex_19: .. tab-set:: .. tab-item:: Example 4 : Call by Reference : Pass Address of Double Dimension array to a function * Step 1 : Consider a double dimension array created using a integer double pointer .. code-block:: c int **dp; dp = malloc(2 * sizeof(int *)); for (int i = 0; i < 2; i++) { dp[i] = malloc(3 * sizeof(int)); } dp[0][0] = 11; dp[0][1] = 22; dp[0][2] = 33; dp[1][0] = 44; dp[1][1] = 55; dp[1][2] = 66; * Step 2 : Pass Address of Double Dimension array to a function .. code-block:: c fun(&dp); * Step 3.1 : Define function ``fun`` .. code-block:: c void fun(int ***ptr ) { } * Step 3.2 : Access and change individual integers inside function ``fun`` .. code-block:: c int data = 99; for (int i = 0 ; i < 2; i++) { for (int j = 0 ; j < 3; j++) { (*ptr)[i][j] = data++; } } * Step 4 : Free memory after usage .. code-block:: c for (int i = 0; i < 2; i++) { free(dp[i]); } free(dp); * See full program below .. code-block:: c #include #include void fun(int ***ptr) { int data = 99; for (int i = 0 ; i < 2; i++) { for (int j = 0 ; j < 3; j++) { (*ptr)[i][j] = data++; } } } int main(void) { int **dp; dp = malloc(2 * sizeof(int *)); for (int i = 0; i < 2; i++) { dp[i] = malloc(3 * sizeof(int)); } dp[0][0] = 11; dp[0][1] = 22; dp[0][2] = 33; dp[1][0] = 44; dp[1][1] = 55; dp[1][2] = 66; printf("----- Before Call By Reference -----\n"); for (int i = 0; i < 2; i++) { for (int j = 0; j < 3; j++) { printf("dp[%d][%d] = %d\n", i, j, dp[i][j]); } } fun(&dp); printf("----- After Call By Reference -----\n"); for (int i = 0; i < 2; i++) { for (int j = 0; j < 3; j++) { printf("dp[%d][%d] = %d\n", i, j, dp[i][j]); } } for (int i = 0; i < 2; i++) { free(dp[i]); } free(dp); return 0; } * Output is as below .. code-block:: c ----- Before Call By Reference ----- dp[0][0] = 11 dp[0][1] = 22 dp[0][2] = 33 dp[1][0] = 44 dp[1][1] = 55 dp[1][2] = 66 ----- After Call By Reference ----- dp[0][0] = 99 dp[0][1] = 100 dp[0][2] = 101 dp[1][0] = 102 dp[1][1] = 103 dp[1][2] = 104 .. card:: See Also * Other topics of integer and functions * :doc:`./int` * :doc:`./int_sd_array` * :doc:`./int_dd_array` * :doc:`./int_td_array` * :doc:`./int_sp` * :doc:`./int_dp` * :doc:`./int_tp` * Current Module * :doc:`../funcs_n_ptrs` * Previous Module * :doc:`../../typecasting_n_ptr/typecasting_n_ptr` * Next Module * :doc:`../../memcpy_ptr/memcpy_ptr` * Other Modules * :doc:`../../variable_and_ptr/variable_and_ptr` * :doc:`../../array_n_ptrs/array_n_ptrs` * :doc:`../../malloc_ptr/malloc_ptr` * :doc:`../../const_ptr/const_ptr` * :doc:`../../void_ptr/void_ptr` * :doc:`../../array_of_ptr/array_of_ptr` * :doc:`../../ptr_to_array/ptr_to_array` * :doc:`../../function_ptr/function_ptr` * :doc:`../../pre_incr_ptr/pre_incr_ptr` * :doc:`../../post_incr_ptr/post_incr_ptr` * :doc:`../../pre_decr_ptr/pre_decr_ptr` * :doc:`../../post_decr_ptr/post_decr_ptr`