Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Osoba{
- public:
- char ime[14];
- char prezime[14];
- int godine;
- void create(char * i, char * p, int g);
- void predstaviSe();
- };
- void Osoba::create(char * i, char * p, int g){
- int velI = strlen(i) + 1;
- int velP = strlen(p) + 1;
- strcpy_s(ime, velI, i);
- strcpy_s(prezime, velP, p);
- godine = g;
- }
- void Osoba::predstaviSe(){
- cout << "Ime: " << ime << endl << "Prezime: " << prezime << endl << "Godine: " << godine << endl <<endl;
- }
- int main(){
- Osoba a, b, c;
- a.create("Nedim", "Fejzic", 32);
- b.create("Saldina", "Nurak", 13);
- c.create("Mirnes", "Turkovic", 18);
- a.godine = 19;
- b.godine = 19;
- c.godine = 20;
- a.predstaviSe();
- b.predstaviSe();
- c.predstaviSe();
- system("pause > null");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement