Hi,
I've a strange problem in C++ using a class name: profil. I'm unable to find if
this is a C++ keyword and what it means in C++ in my C++ books (B. Stroustrup
"le langage C++" book, Stephen Prata C++ primer + book....) and google do not
help with such widely used word....
The small test code below compile successfully with g++ 4.8.2 but do not compile
with g++ 4.4.[6,7] nor 4.5.1
It do not compile with intel compilers too.
If I replace "profil" by "profile" as the class name it works on all compilers.
Thanks
Patrick
#include <iostream>
using namespace std;
class profil {
private:
public:
profil();
~profil();
};
profil::profil()
{
cout<<"Constructeur"<<endl;
}
profil::~profil()
{
cout<<"Destructeur"<<endl;
}
int main()
{
profil var;
return 0;
}
$ g++ bide.C
bide.C: In function ‘int main()’:
bide.C:24:8: error: expected ‘;’ before ‘var’
--
===================================================================
| Equipe M.O.S.T. | |
| Patrick BEGOU | mailto:Patrick.Begou@xxxxxxxxxxxxxxx |
| LEGI | |
| BP 53 X | Tel 04 76 82 51 35 |
| 38041 GRENOBLE CEDEX | Fax 04 76 82 52 71 |
===================================================================
#include <iostream>
using namespace std;
class profil {
private:
public:
profil();
~profil();
};
profil::profil()
{
cout<<"Constructeur"<<endl;
}
profil::~profil()
{
cout<<"Destructeur"<<endl;
}
int main()
{
profil var;
return 0;
}