![]() |
|
Модераторы: Daevaorn |
![]()
|
|
| Nick112411 |
|
|||
|
Новичок Профиль Группа: Участник Сообщений: 8 Регистрация: 25.10.2006 Репутация: нет Всего: нет |
Здравствуйте! Есть програма
#include <iomanip.h> #include <math.h> #include <iostream.h> #include <string.h> #include <stdio.h> class Bibliographer { public: char *FIO; int god; int god_post; char *categoria; char *otdel; Bibliographer (char *fio,int god1,int god_post1,char *categoria1,char *otdel); ~Bibliographer() {} friend int check(Bibliographer &c); virtual void print() { cout<<"FIO: "<<FIO<<endl; cout<<"god rojdenia: "<<god<<endl; cout<<"god postuplenia: "<<god_post<<endl; cout<<"categoria: "<<categoria<<endl; cout<<"otdel: "<<otdel<<endl; }; }; class Bibliographer_1:public Bibliographer {public: int kol_day; int kol_mon; Bibliographer_1 (char *fio,char *god,int god_post,char *categoria,char *otdel,int kol_d,int kol_m); }; Bibliographer::Bibliographer(char *fio,char *god1,int god_post1,char *categoria1,char *otdel1,int kol_d,int kol_m) { FIO = fio; strcpy(FIO,fio); god=god1; god_post=god_post1; categoria=categoria1; otdel=otdel1; }; Bibliographer_1::Bibliographer_1 (char *fio,char *god,int god_post,char *categoria,char *otdel1,int kol_d,int kol_m): Bibliographer (fio,god,god_post,categoria,otdel) { kol_day=kol_d; kol_mon=kol_m; } int check(Bibliographer &c) {int tt,temp; cout<<"vvedite god postuplenia: "; cin>>temp; if (c.god_post>temp) return (1); else return (0); } void main() { Bibliographer_1 t("f i o",1987,2001,"bibliograph","glavnij"); if (check(t)==1) t.print(); else cout<<"god postuplenia nige vvedennogo"<<endl; getch(); } Выдает 4 ошибки. Пожалуйста если сможете, помогите их исправить. Спасибо Это сообщение отредактировал(а) Nick112411 - 25.11.2006, 18:19 |
|||
|
||||
| vinter |
|
|||
![]() Explorer ![]() ![]() ![]() ![]() Профиль Группа: Завсегдатай Сообщений: 2735 Регистрация: 1.4.2006 Где: Н.Новгород Репутация: 13 Всего: 56 |
пользуйся тегами код, смотреть удобнее..
какие ошибки??.. |
|||
|
||||
| Dray |
|
|||
![]() Материалист ![]() ![]() Профиль Группа: Участник Сообщений: 652 Регистрация: 7.10.2003 Где: г. Всеволожск Репутация: 2 Всего: 6 |
Еще хотелось бы узнать в каких местах компилятор находит ошибки.
Хотя странно. Ведь если узнать какие ошибки и в каких местах, то наверняка получится их исправить самому. |
|||
|
||||
| Nick112411 |
|
|||
|
Новичок Профиль Группа: Участник Сообщений: 8 Регистрация: 25.10.2006 Репутация: нет Всего: нет |
Ошибки:
c:\documents and settings\николай\мои документы\новая папка (4)\laba12_2.cpp(36) : error C2511: 'Bibliographer::Bibliographer' : overloaded member function 'void (char *,char *,int,char *,char *,int,int)' not found in 'Bibliographer' c:\documents and settings\николай\мои документы\новая папка (4)\laba12_2.cpp(8) : see declaration of 'Bibliographer' c:\documents and settings\николай\мои документы\новая папка (4)\laba12_2.cpp(47) : error C2664: '__thiscall Bibliographer::Bibliographer(char *,int,int,char *,char *)' : cannot convert parameter 2 from 'char *' to 'int' This conversion requires a reinterpret_cast, a C-style cast or function-style cast c:\documents and settings\николай\мои документы\новая папка (4)\laba12_2.cpp(61) : error C2661: 'Bibliographer_1::Bibliographer_1' : no overloaded function takes 5 parameters c:\documents and settings\николай\мои документы\новая папка (4)\laba12_2.cpp(63) : error C2065: 'getch' : undeclared identifier Error executing cl.exe. |
|||
|
||||
| vinter |
|
||||||||||||
![]() Explorer ![]() ![]() ![]() ![]() Профиль Группа: Завсегдатай Сообщений: 2735 Регистрация: 1.4.2006 Где: Н.Новгород Репутация: 13 Всего: 56 |
найди десять отличий
7 аргументов а вызываешь с пятью..
Это сообщение отредактировал(а) vinter - 25.11.2006, 19:59 |
||||||||||||
|
|||||||||||||
| Nick112411 |
|
|||
|
Новичок Профиль Группа: Участник Сообщений: 8 Регистрация: 25.10.2006 Репутация: нет Всего: нет |
#include <iomanip.h>
#include <math.h> #include <iostream.h> #include <string.h> #include <stdio.h> #include <conio.h> class Bibliographer { public: char *FIO; int god; int god_post; char *categoria; char *otdel; Bibliographer (char *fio,int god1,int god_post1,char *categoria1,char *otdel); ~Bibliographer() {} friend int check(Bibliographer &c); virtual void print() { cout<<"FIO: "<<FIO<<endl; cout<<"god rojdenia: "<<god<<endl; cout<<"god postuplenia: "<<god_post<<endl; cout<<"categoria: "<<categoria<<endl; cout<<"otdel: "<<otdel<<endl; }; }; class Bibliographer_1:public Bibliographer {public: int kol_day; int kol_mon; Bibliographer_1 (char *fio,int god,int god_post,char *categoria,char *otdel,int kol_d,int kol_m); }; Bibliographer::Bibliographer(char *fio,int god1,int god_post1,char *categoria1,char *otdel1,int kol_d,int kol_m) { FIO = fio; strcpy(FIO,fio); god=god1; god_post=god_post1; categoria=categoria1; otdel=otdel1; }; Bibliographer_1::Bibliographer_1 (char *fio,int god,int god_post,char *categoria,char *otdel1,int kol_d,int kol_m): Bibliographer (fio,god,god_post,categoria,otdel) { kol_day=kol_d; kol_mon=kol_m; } int check(Bibliographer &c) {int tt,temp; cout<<"vvedite god postuplenia: "; cin>>temp; if (c.god_post>temp) return (1); else return (0); } void main() { Bibliographer_1 t("f i o",1987,2001,"bibliograph","glavnij",198,788); if (check(t)==1) t.print(); else cout<<"god postuplenia nige vvedennogo"<<endl; getch(); } Одна ошибка: C:\Documents and Settings\Íèêîëàé\Ìîè äîêóìåíòû\Íîâàÿ ïàïêà (4)\laba12_2.cpp(37) : error C2511: 'Bibliographer::Bibliographer' : overloaded member function 'void (char *,int,int,char *,char *,int,int)' not found in 'Bibliographer' C:\Documents and Settings\Íèêîëàé\Ìîè äîêóìåíòû\Íîâàÿ ïàïêà (4)\laba12_2.cpp(9) : see declaration of 'Bibliographer' Error executing cl.exe. Это сообщение отредактировал(а) Nick112411 - 26.11.2006, 11:15 |
|||
|
||||
| vinter |
|
||||
![]() Explorer ![]() ![]() ![]() ![]() Профиль Группа: Завсегдатай Сообщений: 2735 Регистрация: 1.4.2006 Где: Н.Новгород Репутация: 13 Всего: 56 |
а сам посмотреть немог?? и пользуйся тегами кода!! |
||||
|
|||||
| Nick112411 |
|
|||
|
Новичок Профиль Группа: Участник Сообщений: 8 Регистрация: 25.10.2006 Репутация: нет Всего: нет |
Спасибо! Запускается, но выдает ошибку приложения
|
|||
|
||||
| Earnest |
|
|||
![]() Эксперт ![]() ![]() ![]() ![]() Профиль Группа: Экс. модератор Сообщений: 5962 Регистрация: 17.6.2005 Где: Рязань Репутация: 53 Всего: 183 |
Предлагаешь нам опыть угадать, какую?
И исправь, пожалуйста, свои первые посты с помощью тэгов кода, которыми ты уже умеешь пользоваться. -------------------- ... |
|||
|
||||
![]()
|
| Правила форума "С++:Общие вопросы" | |
|
|
Добро пожаловать!
Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Earnest Daevaorn |
| 0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей) | |
| 0 Пользователей: | |
| « Предыдущая тема | C/C++: Общие вопросы | Следующая тема » |
|
|
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности Powered by Invision Power Board(R) 1.3 © 2003 IPS, Inc. |