-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
43 lines (29 loc) · 679 Bytes
/
main.cpp
File metadata and controls
43 lines (29 loc) · 679 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//
// main.cpp
// ProblemSolving
//
// Created by Tahiatul Islam on 7/4/18.
// Copyright © 2018 xenon. All rights reserved.
//
#include <iostream>
using namespace std;
void arrayPrintngWithPointer () {
int v[3] = {3,5,8};
int *ptr;
ptr = &v[0];
cout<<"element of array are \n";
cout << ptr[0] << " "<<ptr[1]<<" "<<ptr[2]<<"\n";
}
void pointerDetail(){
int var = 10;
int *ptr = &var;
printf("content of ptr = %d",*ptr);
printf("\n content address of ptr = %p",ptr);
printf("\n address of ptr = %p\n", &ptr);
}
int main() {
// insert code here...
// arrayPrintngWithPointer();
pointerDetail();
return 0;
}