syntax error befor '::' token... what to do ???

T

Ti-Gui

//TInscription.cpp"
#include <iostream>
#include <cstring>

#include "TInscription.h"
#include "TDate.h"
#include "TAdresse.h"

TInscription::TInscription(char szIdentification[80],int iAge,TAdresse Adresse,
TDate DateInscription,TDate DateDebut,int iNbBillet)
{

}

virtual void TInscription::EntreInfo()
{
}

void TInscription::CalculNbBillet()
{
}

virtual void TInscription::AfficherInfo()
{
}

//TInscription.h
#ifdef TINSCRIPTION_H
#define TINSCRIPTION_H

class Inscription
{
public:
Inscription(char="",int=0,TAdresse="",TDate=(0,0,0),TDate=(0,0,0),int=0);
virtual void EntreInfo();
void CalculNbBillet();
virtual void AfficherInfo();

protected:
char szIdentificateur[60];
int iAge;
TAdresse Adresse;
TDate DateInscription;
TDate DateDebut;
int iNbBillet;
};
#endif
 
J

John Harrison

Ti-Gui said:
//TInscription.cpp"
#include <iostream>
#include <cstring>

#include "TInscription.h"
#include "TDate.h"
#include "TAdresse.h"

Move these two includes to your header file. When the compiler compiles
"TInscription.h" it doesn't know what TDate or TAdresse are. Every header
file should include the header files it needs to compile.

john
 
D

David White

Doesn't your compiler's error message give a line number? You shouldn't
expect people to examine every line when you could have given the line
number. That said, I took a wild guess at the reason for the error and I
might have got lucky.

The line:
#ifdef TINSCRIPTION_H

should be:
#ifndef TINSCRIPTION_H

DW
 
A

Alexey Rusakov

TInscription::TInscription(char szIdentification[80],int iAge,TAdresse
and

class Inscription

Besides, as already posted, there should be #ifndef instead of #ifdef. Be
more careful next time: such an error is not easy to detect from compiler
messages.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top