Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void fun(int *tab1, int size){
  6. for (int i=0; i<size;i++){
  7. cout << tab1[i] << endl;
  8. }
  9. cout << tab1 << endl;
  10. cout << &tab1 << endl;
  11. }
  12.  
  13. int main() {
  14.  
  15. int tab1[] = {1,2,3}, tab2[] = {4,5,6}, *tab3;
  16.  
  17. fun(tab1, 3);
  18. cout << "-----------------" << endl;
  19. cout << &tab1 << endl;
  20. cout << tab1 << endl;
  21. cout << &tab1[0] << endl;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement