Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<string>
- using namespace std;
- class Student{
- int an,medie;
- string nume;
- public:void setNume(string);
- void showNume();
- };
- void Student::setNume(string nume) {
- Student::nume = nume;
- }
- void Student::showNume() {
- cout << nume;
- }
- int main()
- {
- Student stud[1];
- string as;
- for (int i = 0; i < 2; i++) {
- cout << "Introduceti numele pentru studentul " << i << " : ";
- cin >> as;
- stud[i].setNume(as);
- }
- //system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement