Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Student {
- private:
- int indeks;
- char ime[50];
- char prezime[50];
- public:
- void set_idenks(int i) {
- indeks = i;
- }
- void set_ime(char *c) {
- strcpy(ime, c);
- }
- void set_prezime(char *c) {
- strcpy(prezime, c);
- }
- void print() {
- cout << ime << " " << prezime << " " << indeks << endl;
- }
- };
- int main() {
- Student niza[1];
- niza[0].set_idenks(10);
- niza[0].set_ime("josif");
- niza[0].set_prezime("josif");
- niza[0].print();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement