Guest User

Untitled

a guest
May 7th, 2012
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. void quepassa::CrearConversacion() {
  2. Conversacion Con, conver;
  3. PilaConversaciones P;
  4. Contacto C;
  5. string N, cad;
  6. bool est = false;
  7. bool enc = false;
  8. int num;
  9.  
  10. cout << "Nombre del destinatario: " << endl;
  11. getline(cin,N);
  12. C.PutNombre(N);
  13.  
  14. if (BuscarContacto(C) == true) {
  15. cout << "Primer mensaje" << endl;
  16. getline(cin,cad);
  17. Con.PutReceptor(N);
  18. Con.PutTexto(cad);
  19.  
  20. if (chat.estaVacia())
  21. num = 0;
  22. else {
  23. chat.Cima(conver);
  24. conver.GetIdentificador(num);
  25. num=num+1;
  26. }
  27. Con.PutIdentificador(num);
  28.  
  29. if (!chat.estaLleno())
  30. chat.Apilar(Con);
  31. else {
  32. while (!chat.estaVacia()) {
  33. chat.Cima(conver);
  34. P.Apilar(conver);
  35. chat.Desapilar();
  36. }
  37. while (!P.estaVacia() && !enc) {
  38. P.Cima(conver);
  39. conver.GetEstado(est);
  40. if (est == false) {
  41. P.Desapilar();
  42. enc = true;
  43. }
  44. else {
  45. chat.Apilar(conver);
  46. P.Desapilar();
  47. }
  48. }
  49. while (!P.estaVacia()) {
  50. P.Cima(conver);
  51. chat.Apilar(conver);
  52. P.Desapilar();
  53. }
  54. chat.Apilar(Con);
  55. }
  56. }
  57. else
  58. cout << "El contacto no esta en tu lista de contactos." << endl;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment