,   CyberForum.ru

- C++


C++ , , ? http://www.cyberforum.ru/cpp-beginners/thread731097.html
#include <iostream> using namespace std; void array_y(int ) void array_z(int ) int main() {
C++ # include <stdio.h> # include <conio.h> int menu(int kp, char*NAZ); void main(void); int zadacha3 (int n, float *a, float *s); int zadacha3(int n, int *a, int*s); int zadacha3(int n, double *a, double*s); http://www.cyberforum.ru/cpp-beginners/thread731091.html
C++ ,
, . ..
C++ c ,
!!! ! c , =/ !
C++ http://www.cyberforum.ru/cpp-beginners/thread731084.html
: #include <iostream.h> #include <stdio.h> int main() { struct strc{ char fio; int otc; double sb;
C++ .. , , , , , . , #include <iostream> #include <cstring> #include <clocale> using namespace std; enum yn {no,yes};// yn no,yes enum color{red,yellow,green,orange};//...

j_runner
0 / 0 / 0
: 21.11.2012
: 26
16.12.2012, 00:20  []    
!



C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#include <iostream>
#include <iomanip>
#include <typeinfo>
#include <string>
#include <sstream>
#include "menu.h"
  
  menu_option::menu_option(std::string _title):title(_title)
  {
  }   
  void menu_option::on_select()  
  {
  }
  std::string get_title()
  {
  return _title;
  }
 
 
/********************************************************/
  
  menu_option* list[9];
  sub_menu::sub_menu(std::string _title):menu_option(_title)
  {
    int i=0;
  }
    
  void menu_option::add_option(sub_menu* _menu)
  { int i;
    if(i < 9)
    {
    list[i]= _menu;     
    i++;
    }
 }   
    
   void menu_option::on_select()
  {
    int n;
    cout << title << endl;
    display();
    cout << "choice option: ";
    cin >> n; 
    list[n]->on_select();
  }
  
  void menu_option::display()
  { int i;
    for(int ii=0;ii<i;ii++)
      cout << ii  << list[ii]->title << endl;  
    cout << i << "Return" <<endl;  
  }
 
 
 
 
 /*******************************************************/
   
    add_book::add_book (std::string _title):sub_menu(_title){}
    add_book::add_book (std::string _title, Database *_base):sub_menu(_title){base=_base;}
   Database *base;
    void add_book::get_title()
    {
    }
    void add_book::on_select()
    {
    cout<<"enter book information"<<endl;
    base->list[base->i] = new book(" ", 0, " ");
    base->list[base->i]->input();
    base->i++;
    }
    
  
 
 
/*****************************************************************************/
 
    
    add_movie::add_movie(std::string _title):sub_menu(_title){}
    add_movie::add_movie(std::string _title, Database *_base):sub_menu(_title){base=_base;}
   Database *base;
  
    void add_movie::get_title()
    {
    }
    void add_movie::on_select()
    {
    cout<<"enter movie information"<<endl;
    base->list[base->i] = new movie(" ", 0, 0);
    base->list[base->i]->input();
    base->i++;
    }
/**************************************************************************/
    
    add_grocery::add_grocery (std::string _title):sub_menu(_title){}
    add_grocery::add_grocery (std::string _title, Database *_base):sub_menu(_title){base=_base;}
   Database *base;
  
    void add_grocery::get_title() 
    {
    }
    void add_grocery::on_select()
    {
    cout<<"enter grocery information:"<<endl;  
    base->list[base->i] = new grocery(" ", 0, 0);
    base->list[base->i]->input();
    base->i++;
    
    cout << list[0]->title << endl;  
    }
 
/*************************************************************************/
  
 
  print_database::print_database(std::string _title):sub_menu(_title){}
 print_database::print_database(std::string _title, Database *_base):sub_menu(_title){base=_base;}
  
 Database *base;
  
  void print_database::display()
  {
  }
  void print_database::on_select()
  {
  }


C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include <iomanip>
#include <iostream>
#include<string>
 
#include "database.h"
 
using namespace std;
 
class menu_option {
 
  
 
public:
string title;
   menu_option();
   menu_option(const menu_option&);
   
   menu_option(std::string _title);
 virtual ~menu_option();
  
  virtual void on_select();
  std::string get_title();
  void display();
};
/************************************************/
class sub_menu : public menu_option { 
public:
  sub_menu();
  sub_menu(std::string _title);
  sub_menu(const sub_menu&);
 virtual ~sub_menu();
  menu_option* list[];
  int count;
  add_option(sub_menu* _menu); 
};
 
/*************************************************/
 class add_book : public sub_menu { 
public:   
add_book();
add_book(const add_book&);
add_book(std::string _title);
virtual ~add_book();
 add_book(Book book, Database * database);
   void on_select();    
 
};
/*************************************************/
class add_movie : public sub_menu { 
public:  
add_movie();
add_movie(const add_movie&);
add_movie(std::string _title);
virtual ~add_movie();
add_movie(Movie movie, Database * database);
 
void on_select();  
    
};
/******************************************************/
class add_grocery: public sub_menu { 
public:   
add_grocery();
add_grocery(const add_grocery&);
add_grocery(std::string _title);
virtual ~add_grocery();
 
//add_grocery(Grocery grocery, Database * database);
add_grocery(Grocery,Database*);
 
void on_select();     
   
};
/*******************************************************************/
class print_database : public sub_menu { 
  print_datbase();
  print_database(const print_database&);
  print_database(std::string _title);
virtual ~print_database();
 
  void display();
  void on_select();
    
};



In file included from menu.cc:6:
menu.h:34: error: ISO C++ forbids declaration of add_option with no type
menu.h:26: warning: class sub_menu has pointer data members
menu.h:26: warning: but does not override operator=(const sub_menu&)
menu.h:76: error: ISO C++ forbids declaration of print_datbase with no type
menu.cc: In function std::string get_title():
menu.cc:16: error: _title was not declared in this scope
menu.cc: In constructor sub_menu::sub_menu(std::string):
menu.cc:23: warning: sub_menu::count should be initialized in the member initialization list
menu.cc:25: warning: unused variable i
menu.cc: At global scope:
menu.cc:28: error: no void menu_option::add_option(sub_menu*) member function declared in class menu_option
menu.cc:37: error: redefinition of void menu_option::on_select()
menu.cc:11: error: virtual void menu_option::on_select() previously defined here
menu.cc:60: error: prototype for add_book::add_book(std::string, Database*) does not match any in class add_book
menu.h:44: error: candidates are: add_book::add_book(Book, Database*)
menu.cc:59: error: add_book::add_book(std::string)
menu.h:41: error: add_book::add_book(const add_book&)
menu.h:40: error: add_book::add_book()
menu.cc:62: error: no void add_book::get_title() member function declared in class add_book
menu.cc: In member function virtual void add_book::on_select():
menu.cc:68: error: expected type-specifier before book
menu.cc:68: error: cannot convert int* to Product* in assignment
menu.cc:68: error: expected ; before book
menu.cc: At global scope:
menu.cc:80: error: prototype for add_movie::add_movie(std::string, Database*) does not match any in class add_movie
menu.h:55: error: candidates are: add_movie::add_movie(Movie, Database*)
menu.cc:79: error: add_movie::add_movie(std::string)
menu.h:52: error: add_movie::add_movie(const add_movie&)
menu.h:51: error: add_movie::add_movie()
menu.cc:81: error: redefinition of Database* base
menu.cc:61: error: Database* base previously declared here
menu.cc:83: error: no void add_movie::get_title() member function declared in class add_movie
menu.cc: In member function virtual void add_movie::on_select():
menu.cc:89: error: expected type-specifier before movie
menu.cc:89: error: cannot convert int* to Product* in assignment
menu.cc:89: error: expected ; before movie
menu.cc: At global scope:
menu.cc:96: error: prototype for add_grocery::add_grocery(std::string, Database*) does not match any in class add_grocery
menu.h:69: error: candidates are: add_grocery::add_grocery(Grocery, Database*)
menu.cc:95: error: add_grocery::add_grocery(std::string)
menu.h:64: error: add_grocery::add_grocery(const add_grocery&)
menu.h:63: error: add_grocery::add_grocery()
menu.cc:97: error: redefinition of Database* base
menu.cc:61: error: Database* base previously declared here
menu.cc:99: error: no void add_grocery::get_title() member function declared in class add_grocery
menu.cc: In member function virtual void add_grocery::on_select():
menu.cc:105: error: expected type-specifier before grocery
menu.cc:105: error: cannot convert int* to Product* in assignment
menu.cc:105: error: expected ; before grocery
menu.cc: At global scope:
menu.cc:116: error: prototype for print_database:rint_database(std::string, Database*) does not match any in class print_database
menu.cc:115: error: candidates are: print_database:rint_database(std::string)
menu.h:77: error: print_database:rint_database(const print_database&)
menu.cc:118: error: redefinition of Database* base
menu.cc:61: error: Database* base previously declared here
menu.h:34: error: ISO C++ forbids declaration of add_option with no type
menu.h:26: warning: class sub_menu has pointer data members
menu.h:26: warning: but does not override operator=(const sub_menu&)
menu.h:76: error: ISO C++ forbids declaration of print_datbase with no type
 
: 17:00. GMT +3.
- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
@Mail.ru