Bonjour,
j'essaye d'utiliser un attribut déclaré en "static const" comme taille de tableau.
Dans le header :
dans le fichier d'implémentation:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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];
j'utilise Visual C++ 6.0 avec XP, l'erreur remontée :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 const int GPSFrame::m_MaxSize = 80;
alors peut être qu'il est évident que cela ne peut marcher, mais moi un truc m'échappe...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
![]()
Partager