Advertisement
diegoaguilar

biblioteca

Mar 19th, 2012
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.26 KB | None | 0 0
  1. //biblioteca.cpp
  2. //Para 100 usuarios
  3.  
  4. #include <iostream>
  5. #include <string>
  6. using namespace std;
  7.  
  8. class usuario;
  9.  
  10. class libro{
  11.  
  12. private:
  13.         int     isbn;
  14.         char*   titulo;
  15.         char*   autor;
  16.         char*   categoria;
  17.         bool    estado;
  18. static int      indicel;
  19.  
  20. public:
  21.         static  int     prestamos;
  22.         void alta(int, char*, char*, char*);
  23.         friend void prestamo();
  24.         friend void devolucion();
  25.         friend void check();
  26. };
  27.  
  28. class usuario{
  29.  
  30. private:
  31.         char*   nombre;
  32.         int     cuenta;
  33. static int      indiceu;
  34.  
  35. public:
  36.         void alta(char*);      
  37.         void mostrar(char*);
  38.         friend void prestamo();
  39.         friend void devolucion();
  40. };
  41.  
  42. void libro :: alta(int isbn, char* titulo, char* autor, char* categoria)     //COMO asignar a libro[indice].......Hasta el main que maneja la variable i
  43. {
  44. this->isbn=isbn;
  45. this->titulo=titulo;
  46. this->autor=autor;
  47. this->categoria;
  48. estado=false;
  49. }
  50.  
  51. void check()
  52. {
  53. cout<<prestamos;                        //STATIC
  54. }
  55.  
  56. void usuario :: alta(char* nombre)
  57. {
  58. this->nombre=nombre;
  59. cuenta=0;
  60. }
  61.  
  62. /* void prestamo(char* titulo, char* usuario)
  63. {
  64. for(i=0; i<100; i++)
  65. if (strcmp(titulo, )
  66. }
  67.  
  68. void devolucion(char* titulo, char* usuario)
  69. {
  70.  
  71. }*/
  72.  
  73. int libro :: prestamos=0;
  74.  
  75. int main ()
  76. {
  77. libro   array_libros[100];
  78. usuario array_usuarios[100];
  79.  
  80. return 0;
  81.  
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement