Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
i wrote this code and when run it it tells me : TTp has stopped Working
i do this on eclipce and it dosent run at all

C++
#include <iostream>
#include<string>
#include <list>

#include "Classe.h"
#include "Groupe.h"
#include "Moudule.h"
#include "Professeur.h"
#include "Lemploi.h"


using namespace std;


int main()
{


	Professeur	p1(1,"teggar");
	Professeur	p2(2,"salem");
	Professeur  p3(3,"benmimoun");
	Professeur	p4(4,"dergale");

	Moudule
	    m1(1,"algo cour"),
		m2(2,"GL cour"),
		m3(3,"BDD cour"),
		m4(4,"algo td"),
		m5(5,"algo tp"),
		m6(6,"GL td"),
		m7(7,"LM cour"),
		m8(8,"LM td");

	Groupe
	    g1(1,"g1"),
		g2(2,"g2"),
		g3(3,"g3"),
		g4(4,"g4"),
		g5(5,"g5"),
		g6(6,"g6"),
		g7(7,"g7"),
		g8(8,"g8");

	Classe
	   c1(1,1,&p1,&g1,&m1),
	   c2(2,2,&p1,&g1,&m4),
	   c3(3,3,&p1,&g1,&m5),
	   c4(4,1,&p2,&g1,&m2),
	   c5(5,2,&p2,&g1,&m6),
	   c12(12,2,&p4,&g1,&m8),
	   c13(13,1,&p4,&g1,&m7),
	   c6(6,1,&p1,&g2,&m1),
	   c7(7,2,&p1,&g2,&m4),
	   c8(8,3,&p1,&g2,&m5),
	   c9(9,1,&p2,&g2,&m2),
	   c11(11,2,&p2,&g2,&m6),
	   c14(14,1,&p4,&g2,&m7);

	Lemploi lp;


	   lp.GetMat(0,0).push_back(&c1);
	   lp.GetMat(0,0).push_back(&c9);
	   lp.GetMat(0,1).push_back(&c3);
	   lp.GetMat(0,2).push_back(&c4);
	   lp.GetMat(0,3).push_back(&c7);
	   lp.GetMat(0,1).push_back(&c6);
	   lp.GetMat(0,4).push_back(&c8);
	   lp.GetMat(0,2).push_back(&c2);
	   lp.GetMat(0,4).push_back(&c11);
	   lp.GetMat(0,3).push_back(&c13);

	cout<<"hello this is Working";


     return 0;

}



its stop working after i add this :
C#
lp.GetMat(0,0).push_back(&c1);
     lp.GetMat(0,0).push_back(&c9);
     lp.GetMat(0,1).push_back(&c3);
     lp.GetMat(0,2).push_back(&c4);
     lp.GetMat(0,3).push_back(&c7);
     lp.GetMat(0,1).push_back(&c6);
     lp.GetMat(0,4).push_back(&c8);
     lp.GetMat(0,2).push_back(&c2);
     lp.GetMat(0,4).push_back(&c11);
     lp.GetMat(0,3).push_back(&c13);
Posted
Updated 31-Oct-15 3:00am
v2
Comments
phil.o 31-Oct-15 9:15am    
And what your debugger is telling you? I don't do C++, but I can suspect a null pointer. Would be helpful if you included in your question at least the definition of the classes you are using.
Patrice T 31-Oct-15 10:23am    
No error message ?
Bsm Pro 1-Nov-15 5:58am    
no
Maciej Los 31-Oct-15 11:45am    
I would ask this question on proper forum: https://www.eclipse.org/forums/index.php

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900