Topic: Allocation of memory for array[i][j] defined as typedef


Author: "Pliev" <pliev@cityline.ru>
Date: 1999/11/22
Raw View
Hello All!
Who will help, why this code does not work:

typedef char* VALUE;
typedef VALUE STRING [1];
typedef STRING TABLE [1];
TABLE *ptable;
main ()
{
  ptable = new TABLE;
  return 0;
}

The compiler informs a mistake:
error C2440: '=': cannot convert from ' char * (*) [1] ' to ' char * (*) [1]
[1] '
Types pointed to are unrelated; conversion requires reinterpret_cast,
C-style cast or function-style cast

Thank! Dima.
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]