bjr tt le monde
j'ai quelques difficulté pour mon départ avec le c++.
j'utilise le compilateur turbo cpp 4.5 su win xp
ce compilateur est très avar au niveau de l'explication des erreurs
expl: mon premier code utilisant les class est:
Code cplusplus : 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 #include <iostream.h> #include <conio.h> class CLS { int x; float y; public: int z; void f(int,float); void g(); } void CLS::f(int i,float j) {x=i; y=j; } void CLS::g() {cout<<"X="<<x<<"nY="<<y<<"\nZ="<<z; } void main() {CLS var; var.z=6; var.f(10,12.34); var.g(); getch();}
-----------------------
Compiling NONAME00.CPP:
Error NONAME00.CPP 11: Too many types in declaration
Error NONAME00.CPP 12: Type 'CLS' may not be defined here
Error NONAME00.CPP 12: 'CLS::f(int,float)' is not a member of 'CLS'
Error NONAME00.CPP 12: Undefined symbol 'i' in function CLS::f(int,float)
Error NONAME00.CPP 13: Undefined symbol 'j' in function CLS::f(int,float)
-----------------------
j'ai pas pu corriger les erreurs
Partager