This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
C++ incompatability.
- To: egcs-bugs at cygnus dot com
- Subject: C++ incompatability.
- From: Yoni Wexler <wexler at cfar dot umd dot edu>
- Date: Wed, 2 Sep 1998 18:50:03 -0400 (EDT)
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.