Classe relation en c++
zmandar
-
zmandar -
zmandar -
Bonjour,
je veux corriger les erreurs svp aide moi
// bbase.cpp : définit le point d'entrée pour l'application console.
//
#include "stdafx.h"
#include <fstream>
#include <string>
#include <iostream>
using namespace std;
class relation{
string nom_relation
struct attribut {
int nombre_attribut;
string nom_atribut;
string type_attribut;
void affiche();
};
//void personne::affiche() {
// cout << nom << " " << prenom << endl;
//cout << " * " << age << " age" << endl;
//cout << " * " << sexe << endl;
//}
int main () {
FILE* test; // Ce nom ne doit pas être le même que celui du flux fstream
/* creation d' un fichier */
int nombre_attribut;
string nom_atribut;
string type_attribut;
relation R1;
cout << "nombre_attribut"<< endl;
cin >>nombre_attribut;
for(i=0;i<=nombre_attribut;i++){
cout << "nom attribut "<< endl;
cin>>nom_atribut ;
cout << "type attribut "<< endl;
cin >>type_attribut;
}
R1.nombre_attribut=nombre_attribut;
R1.nom_atribut=nom_atribut;
R1.type_attribut=type_attribut;
ofstream fichier("C:\\test.text", ios::out | ios::app);
// ouverture en écriture avec effacement du fichier ouvert
if(fichier)
{
fichier << R1.nom_atribut=nom_atribut<<" ";
cout << "ca a marché" << endl; // vérifier un coup dans la console.
fichier.close();
}
else
{ cerr << "Impossible d'ouvrir le fichier !" << endl;
return 0;
}
persA.affiche();
return 0;
}
je veux corriger les erreurs svp aide moi
// bbase.cpp : définit le point d'entrée pour l'application console.
//
#include "stdafx.h"
#include <fstream>
#include <string>
#include <iostream>
using namespace std;
class relation{
string nom_relation
struct attribut {
int nombre_attribut;
string nom_atribut;
string type_attribut;
void affiche();
};
//void personne::affiche() {
// cout << nom << " " << prenom << endl;
//cout << " * " << age << " age" << endl;
//cout << " * " << sexe << endl;
//}
int main () {
FILE* test; // Ce nom ne doit pas être le même que celui du flux fstream
/* creation d' un fichier */
int nombre_attribut;
string nom_atribut;
string type_attribut;
relation R1;
cout << "nombre_attribut"<< endl;
cin >>nombre_attribut;
for(i=0;i<=nombre_attribut;i++){
cout << "nom attribut "<< endl;
cin>>nom_atribut ;
cout << "type attribut "<< endl;
cin >>type_attribut;
}
R1.nombre_attribut=nombre_attribut;
R1.nom_atribut=nom_atribut;
R1.type_attribut=type_attribut;
ofstream fichier("C:\\test.text", ios::out | ios::app);
// ouverture en écriture avec effacement du fichier ouvert
if(fichier)
{
fichier << R1.nom_atribut=nom_atribut<<" ";
cout << "ca a marché" << endl; // vérifier un coup dans la console.
fichier.close();
}
else
{ cerr << "Impossible d'ouvrir le fichier !" << endl;
return 0;
}
persA.affiche();
return 0;
}
A voir également:
- Classe relation en c++
- Classe ram - Guide
- Ouvrez cette page. dans le code de la page, modifiez la couleur de fond de la classe .pix. un code de 4 chiffres doit apparaître dans la grille. lequel ? ✓ - Forum Programmation
- Bluetooth mercedes classe a 2005 - Forum Autoradio
- Dans le code de la page, modifiez la couleur de fond de la classe .pix. - Forum Réseaux sociaux
- Bluetooth mercedes classe a - Forum Autoradio
des erreurs de compilation
moi je veux implémente l 'operateur algebrique intersection entre deux relation en utilisant c++ et je veux utiliser les fichiers chaque fichier correspond à une relation et contient les valeur des attributs est je fait 2 classe le premier relation et l 'autre attribut svp aide moi
exemple de ce que je veux atteindre
Opération INTERSECTION
Formalisme : R = INTERSECTION (R1, R2) Et en langage SQL
Exemple :
première relation
E1 : Enseignants élus au CA
n° enseignant nom_enseignant
1 DUPONT
3 DURAND
4 MARTIN
5 BERTRAND
E2 : Enseignants représentants syndicaux
deuxième relation
n°enseignant nom_enseignant
1 DUPONT
4 MARTIN
6 MICHEL
On désire connaître les enseignants du CA qui sont des représentants syndicaux.
R2 = INTERSECTION (E1, E2)
n°enseignant nom_enseignant
1 DUPONT
4 MARTIN