Ok alors je vais prendre comme exemple un algo qu´on a fait en cours, qui marche quand je lance le .exe mais quand je l´ouvre avec Builder il ne "marche "plus.
Dans application.cpp
//------------------------------------------------
---------------------------
- pragma hdrstop
- include <conio.h>
- include "application.h"
- include "iostream.h"
void Application::lancer()
{
enum couleur
{
ROUGE,
ORANGE,
VERT,
BLEU,
}
const AGEM=25;
const TEMPSM=2;
int cpt=0;
int age;
int temps;
int acc;
int temps2;
cout<<"Quel age avez-vous?";
cin>>age;
if (age>=AGEM)
{
cpt= cpt+1;
}
cout<<"Depuis combien d´annees avez-vous votre permis?";
cin>>temps;
if (temps>=TEMPSM)
{
cpt=cpt+1;
}
cout<<"Dans combien d´accidents avez-vous ete en cause?";
cin>>acc;
cpt=cpt-acc;
if (cpt<0)
{
cout<<"Vos circonstances ne vous permettent pas d´etre accepte dans notre compagnie";
}
else
{
cout<<"Depuis combien de temps etes-vous dans la compagnie?";
cin>>temps2;
if (temps2>=TEMPSM)
{
cpt=cpt+1;
}
switch (cpt)
{
case ROUGE:
cout<<"Vous pouvez beneficiez du tarif rouge.";
break;
case ORANGE:
cout<<"Vous pouvez beneficiez du tarif orange.";
break;
case VERT:
cout<<"Vous pouvez beneficiez du tarif vert.";
break;
case BLEU:
cout<<"Vous pouvez beneficiez du tarif bleu.";
break;
default:
cout<<"Impossibilite technologique";
break;
}
}
getch();
};
//------------------------------------------------
---------------------------
- pragma package(smart_init)
dans princi.cpp :
//------------------------------------------------
---------------------------
- pragma hdrstop
- include "application.h"
int main(int argc,char*argv[])
{
Application monApplication;
monApplication.lancer();
return 0;
};
//------------------------------------------------
---------------------------
- pragma argsused
et dans application.h
//------------------------------------------------
---------------------------
- ifndef applicationH
- define applicationH
class Application
{
public:
void lancer();
};
//------------------------------------------------
---------------------------
- endif
PS:je viens de commencer(2mois) donc je ne connais encore comment les void, princi.cpp et application.h marche, pour l´instant on fait pas mal d´algo donc je colle tout
Donc je repete ça marche en .exe (le projet a été construit au lycée) mais quand je lance le projet sur mon pc et bin plus rien 