Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <sstream>
- #include <vector>
- using namespace std;
- void f(int x[]){
- cout << &x[0] << " " << x[0] << endl;
- //cout << (x+4) << " " << *(x+4) << endl;
- //cout << x << " " << x[0] << endl;
- }
- int g(int a){
- cout << &a << " " << a << endl;
- }
- int h(vector<int> b){
- cout << &b << " " << b[0] << endl;
- }
- int main(){
- int z = 1;
- cout << &z << " " << z << endl;
- g(z);
- cout << endl << endl;
- vector<int> v(10, 5);
- cout << &v << " " << v[0] << endl;
- h(v);
- cout << endl << endl;
- int a[10] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
- cout << &a[0] << " " << a[0] << endl;
- for(int i = -5; i < 15; ++i){
- //cout << &a[i] << " " << a[i] << endl;
- }
- //cout << endl;
- f(a);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement