Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Momche(char *ime="", char *prezime="", int godini=0){ // Constructor
- strcpy(this->ime, ime);
- strcpy(this->prezime, prezime);
- this->godini = godini;
- }
- Momche(const Momche &d){ //copy constructor
- strcpy(ime, d.ime);
- strcpy(prezime, d.prezime);
- godini = d.godini;
- }
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- void set_from(char *from){
- strcpy(this->from, from);
- }
- char* get_from(){
- return this->from;
- }
- void set_kluc(int kluc){
- this->kluc = kluc;
- }
- int get_kluc(){
- return this->kluc;
- }
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- this->text = new char[strlen(text)+1]; //Dinamichka alokacija za char
- strcpy(this->text, text);
- /////////////////////////////////////////////////////////////////////////////////////////////////
- Lista(const Lista &l){
- this->broevi = l.broevi;
- nizaBroevi = new int[l.broevi]; //Dinamichka alokacija za int
- for(int i=0; i<l.broevi; i++)
- nizaBroevi[i]=l.nizaBroevi[i];
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- Lista& operator = (Lista &l){ //Preoptovaruvanje na =
- if(this!= &l){
- return *this;
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement