Search:

Type: Posts; User: gnncj

Search: Search took 0.00 seconds.

  1. Thread: pass 3D array

    by gnncj
    Replies
    3
    Views
    2,446

    What if we don't know exactly the size of array...

    What if we don't know exactly the size of array we gonna pass to func()?
    How can we create a func() which can accept any size of array?
  2. Thread: pass 3D array

    by gnncj
    Replies
    3
    Views
    2,446

    pass 3D array

    For 2D array, we can pass the array to other function like:


    int array[5][10];
    ...
    func((int *)array, 5, 10);
    ...
    ...
    int func(int *array, int x, int y) {
    *(array + y * 0 + 8) = 1000; ...
  3. Replies
    9
    Views
    12,282

    Should be for( x = 0; argv[ x ]; x++ ) , not for(...

    Should be for( x = 0; argv[ x ]; x++ ) , not for( x = 0; *argv[ x ]; x++ ) . otherwise it will cause a segmentation fault.
Results 1 to 3 of 3