Advertisement
Guest User

Untitled

a guest
Aug 7th, 2011
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. void changeArray(int a[]);
  5. void changePri(int );
  6.  
  7.  
  8. int main(){
  9.     int b=1;
  10.     int a[]={2,2,2};
  11.     changeArray(a);
  12.     for(int i=0;i<3;i++){
  13.         cout << a[i]<<",";
  14.     }
  15.     cout <<"\n";
  16.     cout <<"----------------"<<endl;
  17.     changePri(b);
  18.     cout << b;
  19.    
  20.     return 0;
  21. }
  22.  
  23. void changeArray(int a[]){
  24.     a[2]=1;
  25. }
  26.  
  27. void changePri(int a){
  28.     a=2;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement