בוריס מקן חולון
New member
למישהו יש מושג..?
מה לא בסדר בהגדרה של הפונקציה הבונה של המחלקות היורשות? #include <iostream.h> #include <string.h> #include <conio.h> #include <fstream.h> #include <stdlib.h> #include <ctype.h> class nosea{ char fname[20], lname[20]; long id; public: nosea *next; static int n; void show() { cout<<"Name: "<<fname<<" "<<lname<<" ID: "<<id<<endl; } nosea(char fnam[], char lnam[], long idd); ~nosea(); }; class local
ublic nosea{ long milid; char adress[20]; long tel; public: void show() { cout<<"Militairy ID: "<<milid<<" adress: "<<adress<<" telephone: "<<tel<<endl; } local(long millid, char *adres, long tell); ~local(); }; struct date{ int day,month,year; }; class tour
ublic nosea{ char count[20]; struct date dat; public: void show() { cout<<"Country: "<<count<<" Date: "<<dat.day<<"/"<<dat.month<<"/"<<dat.year<<endl; } tour(char *coun, int day, int month, int year); ~tour(); }; /*class list{ nosea *head; public: list(char *fnam, char *lnam, long idd) { head = new nosea(char *fnam, char *lnam, long idd) } ~list(); };*/ void klita(); char menu(); void show(); void main() { char ch; fstream nos, tou, loc; nos.open("nos.dat", ios::in|ios:
ut); tou.open("tou.dat", ios::in|ios:
ut); loc.open("loc.dat", ios::in|ios:
ut); while(ch != -1) { ch = menu(); tolower(ch); switch(ch) { case ´n´: klita(); break; case ´e´: show(); break; case ´c´: system("cls"); break; } } } char menu() { char ch; cout<<"New tourist\nEnter date\nClear screen\n Enter choice: "; cin>>ch; return ch; } nosea::nosea(char *fnam, char *lnam, long idd) { strcpy(fname, fnam); strcpy(lname, lnam); id = idd; } local::local(long millid, char *adres, long tell) : nosea(fnam[20], lnam[20], idd) { strcpy(adress, adres); tel = tell; milid = millid; } tour::tour(char *coun, int day, int month, int year) : nosea(*fnam, *lnam, idd) { strcpy(count, coun); dat.day = day; dat.month = month; dat.year = year; }
מה לא בסדר בהגדרה של הפונקציה הבונה של המחלקות היורשות? #include <iostream.h> #include <string.h> #include <conio.h> #include <fstream.h> #include <stdlib.h> #include <ctype.h> class nosea{ char fname[20], lname[20]; long id; public: nosea *next; static int n; void show() { cout<<"Name: "<<fname<<" "<<lname<<" ID: "<<id<<endl; } nosea(char fnam[], char lnam[], long idd); ~nosea(); }; class local