Advertisement
Josif_tepe

Untitled

Mar 26th, 2021
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class Student {
  6.     char ime[50];
  7.     char prezime[50];
  8.     int godina;
  9.     double prosek;
  10. public:
  11.     Student() {}
  12.     Student(char *i, char *p, int _godina, double _prosek) {
  13.         strcpy(ime, i); // string copy
  14.         strcpy(prezime, p);
  15.         godina = _godina;
  16.         prosek = _prosek;
  17.     }
  18.    
  19.    
  20. };
  21. int main() {
  22.     char ime[50];
  23.     char prezime[50];
  24.     int g;
  25.     double p;
  26.     cin >> ime >> prezime >> g >> p;
  27.    
  28.     Student s;
  29.     Student s2(ime, prezime, g, p);
  30.     return 0;
  31. }
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement