This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

C++ incompatability.


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]