static const et taille de tableau
Bonjour,
j'essaye d'utiliser un attribut déclaré en "static const" comme taille de tableau.
Dans le header :
Code:
1 2 3 4 5 6 7 8
|
private:
// --- ATTRIBUTES --- //
/*! maximum size of the buffer, specified by the NMEA protocol */
static const int m_MaxSize;
/*! buffer of the frame. It contains the Ascii coded chars of the
NMEA frame . */
char m_Frame[m_MaxSize]; |
dans le fichier d'implémentation:
Code:
1 2
|
const int GPSFrame::m_MaxSize = 80; |
j'utilise Visual C++ 6.0 avec XP, l'erreur remontée :
Citation:
d:\continuus\sources\engine\gps\gpsframe.h(24) : error C2057: expected constant expression
d:\continuus\sources\engine\gps\gpsframe.h(24) : warning C4200: nonstandard extension used : zero-sized array in struct/union
alors peut être qu'il est évident que cela ne peut marcher, mais moi un truc m'échappe...
:?