Search Results

Search found 1 results on 1 pages for 'user355638'.

Page 1/1 | 1 

  • int ** vs int [ROWS][COLS]

    - by user355638
    I have a 2D array declared like this: int arr[2][2]={ {1,2},{3,4}}; Now if I do: int ** ptr=(int**) arr; and: cout<<**ptr; I am getting a segmentation fault (using g++-4.0). Why so? Shouldn't it be printing the value 1 (equal to arr[0][0])?

    Read the article

1