[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Code Question
From: |
Marcus A Martin |
Subject: |
Code Question |
Date: |
Fri, 15 Jun 2001 16:08:20 -0400 |
I am making a subtle mistake here, but I am not sure exactly what I am doing
wrong. I know that If I use new to allocate
the 2D array, this works fine. Why does this not work? It compiles fine but
segfaults upon execution. Can anyone help
me figure out this little puzzle?
Marcus
#include <iostream.h>
void foo( double **mat )
{
mat[0][2] = 6.0;
}
int main()
{
double a[10][10];
foo( (double **)a );
return 0;
}
- Code Question,
Marcus A Martin <=