d_imane | Salut codeur,
Le programme ci dessus ne me montre aucune erreur d'execution ,à la fin de l'execution il me sort des erreurs de debogage,je ne sais plus ou est le problème,cqc peut m'aider!!!
Code :
- #include "stdafx.h"
- #include "base.h"
- #include<cstdio>
- #include<math.h>
- #include <windows.h>
- #include<iostream>
- #include<ctime>
- #include<conio.h>
- #include<cstring>
- #include<stdlib.h>
- using namespace std;
- static int compt=0;
- void main(int argc, char* argv[])
- {
- float xmi=3.4,xma=15.6,ymi=3.4,yma=15.6;
- int dim=5;
-
- vecteur vect(xmi,xma,ymi,yma);
- vect.afficher();
- base bas(dim,xmi,xma,ymi,yma);
- bas.afficher(dim);
- getch();
- }
- //==========================vecteur=============================
- vecteur::vecteur(float xmi,float xma,float ymi, float yma)
- {
- srand( (unsigned)time( NULL ) );
- id=compt++;
- x=xmi+fmod((rand()),(xma-xmi));
- y=ymi+fmod((rand()),(yma-ymi));
- }
- void vecteur::afficher()
- {
- cout<<"id= "<<id<<endl;
- cout<<"xy: "<<x<<" "<<y<<endl;
- }
- vecteur::~vecteur(){}
- //================================================================
- base::base(int dim,float a,float b,float c,float d)
- {
- xmin=a;
- xmax=b;
- ymin=c;
- ymax=d;
- vect=new vecteur(a,b,c,d);
- for (int i=0;i<dim;i++)
- {
- vect[i]=vecteur(a,b,c,d);
- }
- }
- void base::afficher(int dim)
- { for (int i=0;i<dim;i++)
- vect[i].afficher();
- }
- base::~base(){}
|
|