Re: [問題] 請問hw1.2的第三題
※ 引述《fairyflame (妖精火燄)》之銘言:
可以問一下
題目第四行的
A(int i =0) : _data(i) {} 是什麼意思嗎?
跟它互看了很久 還是不了解
希望不是個笨問題@@ 謝謝回答
: 題目中的:
: The array size “13” is recorded around “arr’s”
: location in the heap memory (hint: some bytes before arr’s address).
: 是什麼意思呢?
: 是指 A *arr = new A[13]; 之後
: 13這個數字會存在heap memory的某一區之中嗎@@"
: 一直不知道要怎麼取出它的size說...><
: 我在main底下做了嘗試
: int *arr = new int[13];
: cout<<*(arr-1)<<endl;
: 跑出來的並不是13耶@@"
: 在網路上找了好久new的用法 也沒看到哪裡有提到怎麼取出array size
: 可以請哪位大大幫忙開示一下嗎<(_ _)>
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.224.40.190
推
03/12 08:40, , 1F
03/12 08:40, 1F
→
03/12 08:40, , 2F
03/12 08:40, 2F
→
03/12 13:06, , 3F
03/12 13:06, 3F
討論串 (同標題文章)