salut a tous

ici ==> total noob en c++
lol

j'essaie de créer un script simple en c++ et je rencontre plusieurs probleme avec les tableaux

j'ai trouvé des tutos sur les tableaux, mais ils sont tous différents, j'ai suivi plusieurs d'entre eux, mais j'ai toujours le même résultat

je me permet donc de vous soumettre ça

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
28
29
30
31
32
#include <iostream> 

#include <string>
 
int main()
{
int size[5];
filename = new string[5];
string *pfilename = filename;
string dirname[5];
string data[5];
 
// writing filename 
filename[0] = "test.exe";
// writing dirname 
dirname[0] = "c:";
// writing filesize 
filesize[0] = 435;
// writing filename 
filename[1] = "1146671229";
// writing dirname 
dirname[1] = "%windir%";
// writing filesize 
filesize[1] = 243;
// writing filename 
filename[2] = "rog.txt";
// writing dirname 
dirname[2] = "%userprofile%";
// writing filesize 
filesize[2] = 593;
erreurs
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
28
29
 Dans function «
   int main() »:
/var/www/binder/tmp/f8c37c2c350dcb1195a508b7cd337dfe/stub.cpp:10: error: `
   filename' undeclared (first use this function)
/var/www/binder/tmp/f8c37c2c350dcb1195a508b7cd337dfe/stub.cpp:10: error: (Each
   undeclared identifier is reported only once for each function it appears
   in.)
/var/www/binder/tmp/f8c37c2c350dcb1195a508b7cd337dfe/stub.cpp:10: error: erreur
   d'analyse syntaxique before `[' token
/var/www/binder/tmp/f8c37c2c350dcb1195a508b7cd337dfe/stub.cpp:11: error: `
   string' undeclared (first use this function)
/var/www/binder/tmp/f8c37c2c350dcb1195a508b7cd337dfe/stub.cpp:11: error: `
   pfilename' undeclared (first use this function)
/var/www/binder/tmp/f8c37c2c350dcb1195a508b7cd337dfe/stub.cpp:12: error: erreur
   d'analyse syntaxique before `[' token
/var/www/binder/tmp/f8c37c2c350dcb1195a508b7cd337dfe/stub.cpp:19: error: `
   dirname' undeclared (first use this function)
/var/www/binder/tmp/f8c37c2c350dcb1195a508b7cd337dfe/stub.cpp:21: error: `
   filesize' undeclared (first use this function)
/var/www/binder/tmp/f8c37c2c350dcb1195a508b7cd337dfe/stub.cpp:35:19: attention : séquence d'échappement « \/ » inconnue
/var/www/binder/tmp/f8c37c2c350dcb1195a508b7cd337dfe/stub.cpp:35:19: attention : séquence d'échappement « \/ » inconnue
/var/www/binder/tmp/f8c37c2c350dcb1195a508b7cd337dfe/stub.cpp:35:19: attention : séquence d'échappement « \/ » inconnue
/var/www/binder/tmp/f8c37c2c350dcb1195a508b7cd337dfe/stub.cpp:35:19: attention : séquence d'échappement « \/ » inconnue
/var/www/binder/tmp/f8c37c2c350dcb1195a508b7cd337dfe/stub.cpp:35:19: attention : séquence d'échappement « \/ » inconnue
/var/www/binder/tmp/f8c37c2c350dcb1195a508b7cd337dfe/stub.cpp:35:19: attention : constante caractère trop longue pour son type
/var/www/binder/tmp/f8c37c2c350dcb1195a508b7cd337dfe/stub.cpp:35: error: invalid
   initializer
/var/www/binder/tmp/f8c37c2c350dcb1195a508b7cd337dfe/stub.cpp:44: error: `data'
   undeclared (first use this function)
ma version gcc
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
webserver:~# gcc -v
Lecture des spécification à partir de /usr/lib/gcc-lib/i486-linux/3.3.5/specs
Configuré avec: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Modèle de thread: posix
version gcc 3.3.5 (Debian 1:3.3.5-13)
j'ai déjà ecrit les formules de traitement qui vont suivre, mais ça commence mal
lol