Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- class primer{
- int i;
- public:
- primer(int n){
- i=n;
- }
- void postavi_i(int n){
- i=n;
- }
- int zemi_i(){
- return i;
- }
- };
- void soberi(primer *o){
- o->postavi_i(o->zemi_i()+o->zemi_i());
- cout<<o->zemi_i()<<" ";
- }
- int main(){
- primer a(5);
- soberi(&a);
- cout<<a.zemi_i()<<endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment