C++ incompatability.
Yoni Wexler
wexler@cfar.umd.edu
Wed Sep 2 15:50:00 GMT 1998
Hi,
I'm no C++ expert but i think that the following program should compile
flawlessly:
main()
{
char A[3][3] = { {1,2,3}, {4,5,6}, {7,8,9} };
char B[3][3] = A;
typedef char Mat[3][3];
Mat C = { {1,2,3}, {4,5,6}, {7,8,9} };
Mat D = C;
}
but instead the compiler (egcs-1.1a) gives:
t.C: In function `int main()':
t.C:5: invalid initializer
t.C:8: invalid initializer
g++ -v
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
Hope this helps (if not, please ignore)
Yoni.
More information about the Gcc-bugs
mailing list