bonjour,
je cherche à mettre un tableau constant dans une classe mais je voudrais l'initialiser directement :
c'est le tableau extensions.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 #include <iostream> #include <string> extern "C" { #include <dirent.h> #include <string.h> } using namespace std; class ListeRep { private: static const int nbExt = 3; static const char *extensions[nbExt]={"","cc","oo"}; static bool isdir(char *pp); static bool isFile(char *ff); static bool formatOK(char *ff); static bool isIn(char *ext, const char **extensions); public: ListeRep(); static void analyseDir(char *pdir); ~ListeRep(); };
Apperemment ça ne passe pas, pourquoi ?
Partager