Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Student {
- char ime[50];
- char prezime[50];
- int godina;
- double prosek;
- public:
- Student() {}
- Student(char *i, char *p, int _godina, double _prosek) {
- strcpy(ime, i); // string copy
- strcpy(prezime, p);
- godina = _godina;
- prosek = _prosek;
- }
- };
- int main() {
- char ime[50];
- char prezime[50];
- int g;
- double p;
- cin >> ime >> prezime >> g >> p;
- Student s;
- Student s2(ime, prezime, g, p);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement