Getting a Seg Fault with an iostream and pointers
<p>I am trying to read in a data file (a maze), of which I seem to have coded myself a seg fault, I admit that I was sick for the lecture in my college about dynamic allocation, and have searched for my issue throughly, to no avail.
 Here is my snippet of code:</p>

<pre><code>void MazeClass::ReadMaze(ifstream&amp; mazedata) {
    mazedata &gt;&gt; row &gt;&gt; column;  // Pulls the size from the file
    GetExit(mazedata);          // Does the same for above, just for the Exit (Required in Class) 
    GetEntrance(mazedata);      // Does the same, just for the entrance (Required in Class)
    maze = new char*[row];      // First array of pointers for 2d array
    for (unsigned i; i&lt;row;i++)
    {                           // Creates the second set of arrays 
        maze[i]=new char[column];
    }
    for (int y=0;y&lt;column;y++)
    {                           // Keeping the maze inside boundries (step 1)
        for (int x=0;x&lt;row;x++) // (Step 2)
        {
            maze[x][y]=mazedata.get(); // &lt;--- Here is where my Seg Fault happens.
        }
    }

}
</code></pre>

<p>Here is what gdb tells me:</p>

<blockquote>
  <p>Program received signal SIGSEGV, Segmentation fault.
  0x08048fe9 in MazeClass::ReadMaze (this=0xbffff524, mazedata=...) at MazeClass.cpp:36
  36                  maze[x][y]=mazedata.get();</p>
</blockquote>

<p>Thank you ahead of time for all of the help. </p>

<p>Now that my code is fixed by a silly mistake, I am now able to move on to the next problem:</p>

<pre><code>(gdb) run
Starting program: /home/athetius/projects/code/netbeans/OLA4/a.out 
Please Enter Data Filename: MyMaze2.dat


**************12142*********** ***12142*
*            12142***** *     *  12142 *
*           12142 ************  12142***
***   *    12142           ****12142****
*         12142               12142    *
*    ****12142*****   ** *   12142     *
*       12142        *      12142 * *  *
*      12142        *******12142***    *
*     12142*        ** ***12142*********
*    12142               12142          
*   12142  *************12142***       *
*  12142               12142   *****  **
**12142*************  12142 *          *
*12142       ******* 12142            **
12142***************12142
Program exited normally.
</code></pre>

<p>With the output of:
view MyMaze2.dat being:</p>

<pre><code>************************* ****
*            ***** *     *   *
*            ************  ***
***   *               ********
*                            *
*    *********   ** *        *
*               *       * *  *
*              **********    *
*     *        ** ************
*                             
*     ****************       *
*                    *****  **
***************   *          *
*       *******             **
******************************
</code></pre>
