Thursday, May 6, 2010

Arrays

Using an int** for an array of arrays is incorrect and produces wrong answers using pointer arithmetic.

for more details:
http://bytes.com/topic/c/insights/772412-arrays-revealed

1 comment:

  1. # int* func(int arg)
    # {
    # int* temp = new int[arg];
    # return temp;
    # }
    # int main()
    # {
    # int* arr = func(5);
    # }

    to return an array

    ReplyDelete