What does "profil" means in C++

Patrick Begou Patrick.Begou@legi.grenoble-inp.fr
Thu Mar 10 16:08:00 GMT 2016


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@grenoble-inp.fr |
|  LEGI                    |                                      |
|  BP 53 X                 | Tel 04 76 82 51 35                   |
|  38041 GRENOBLE CEDEX    | Fax 04 76 82 52 71                   |
===================================================================

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bide.C
Type: text/x-c++src
Size: 261 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-help/attachments/20160310/327a241a/attachment.bin>


More information about the Gcc-help mailing list