Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- void update(int *a, int *b){
- //plus
- for (size_t i = 0; i < *b; i++){
- (*a)++;
- }
- std::cout << *a << std::endl;
- //minus
- for(size_t i = 0; i < *a;i++){
- (*b)--;
- }
- std::cout << *b << std::endl;
- }
- int main(){
- int a = 4;
- int b = 5;
- update(&a,&b);
- return 0;
- }
Add Comment
Please, Sign In to add comment