0

May you explain me dynamic memory for arrays of this code, please?

I want to know about meaning of al thel code with cout descriptions. https://code.sololearn.com/cie5b03NsO7q/?ref=app

6th Dec 2020, 1:13 PM
lifeismyschool
11 Answers
+ 1
write new int (1) instead of NULL; and check.
6th Dec 2020, 2:46 PM
Hard Maker
Hard Maker - avatar
+ 1
1 and Null are different things Output: p and &p show pass to this variable *p is name variable new int - memory allocation to this variable Also 0 and Null are different things 0- variable value Null- empty variable delete- make variable emty If I don't ansver to all your questions please find it in Google
6th Dec 2020, 5:38 PM
Hard Maker
Hard Maker - avatar
+ 1
Yes, I do
6th Dec 2020, 5:45 PM
Hard Maker
Hard Maker - avatar
+ 1
Yes, you can write number or variable.
6th Dec 2020, 5:56 PM
Hard Maker
Hard Maker - avatar
+ 1
Yes, it is.
6th Dec 2020, 5:59 PM
Hard Maker
Hard Maker - avatar
0
Why output changed after writing new int (1) instead of NULL?
6th Dec 2020, 5:17 PM
lifeismyschool
0
Hard maker, so you say that we can create NULL with delete, don't you?
6th Dec 2020, 5:44 PM
lifeismyschool
0
Thanks a lotâ˜ș
6th Dec 2020, 5:52 PM
lifeismyschool
0
This is the first time, I saw somebody wrote (number) after int. Can we write any number instead of 1?
6th Dec 2020, 5:54 PM
lifeismyschool
0
Is int (1) same with int a=1 ?
6th Dec 2020, 5:59 PM
lifeismyschool
0
Hmm. Thank you so much â˜ș
6th Dec 2020, 6:08 PM
lifeismyschool