IT討論區(179) - any update?
強力飲水 2022-11-27 21:25:04 Pointer 原來有分dynamic allocate to heap / pointer to stack local variable 。。。

Ads

MIDE-823 2022-11-27 21:31:32 fuck WebSecurityConfigureAdapter Depreciated
:^(
手一黏便緊(UTC+9 2022-11-27 21:50:28 手巴個po都講左 pointer還pointer allocation還allocation
你咁既話仲要諗pointer to global pointer to mmap pointer to video memory blar blar blar
強力飲水 2022-11-27 22:13:38 明了。。
pointer 是pointer
New 是new
嘴遁師青花 2022-11-27 23:01:37 完全5識呢D嘢
我還能混下去嗎
:^(
力=質量x加速度 2022-11-27 23:23:25 此回覆已被刪除
手一黏便緊(UTC+9 2022-11-27 23:43:27 最純粹黎講 即係唔理啲類似type咩咩柒柒非必要而又trivial既構造 (yes pointer唔需要有type eg consider asm)
pointer is just a number that does not necessary support arithmetic. ie it is merely a handle, with implementation defined arithmetic


for POSIX, malloc return a pointer to a block, which does not need to be on heap (yes it can on stack, on global segment, on video memory, on disk, or on any fucking things as long as it support space)
https://pubs.opengroup.org/onlinepubs/007904975/functions/malloc.html

new “Creates and initializes objects with dynamic storage duration, that is, objects whose lifetime is not necessarily limited by the scope in which they were created.”
https://en.cppreference.com/w/cpp/language/new
And yes I can code an allocator that allocate on anywhere.
手一黏便緊(UTC+9 2022-11-27 23:51:27 Btw想講下pointer & resource management
啲咩free/delete好難呀 smart pointer 好難用呀 全部都係廢話
即係你fopen完會唔fclose既? 開左個connection會唔close既? lock完之後唔unlock既?
識呢啲就咪話唔識基本memory management。
唔識既一律當做開完任何野都唔識閂既傻閪。
MIDE-823 2022-11-27 23:57:09 try with resources
:^(
全球經濟衰退 2022-11-28 00:03:09 modern c++唔會用呢d c野啦
:^(
手一黏便緊(UTC+9 2022-11-28 00:03:42 邊間firm無old code base
:^(

Ads

全球經濟衰退 2022-11-28 00:16:49 見到呢d一律
:^(
木瓜雪耳 2022-11-28 07:34:46 咁tech 既我出返去先
:^(
錦木ちさと 2022-11-28 08:04:45 屌,神早流流就撞車塞車
加利文 2022-11-28 08:58:10 見過有人開db connection唔close
木瓜雪耳 2022-11-28 09:15:17 有close係反常
媽咪做社工 2022-11-28 09:45:33
:^(
媽咪做社工 2022-11-28 09:50:06
:^(
木瓜雪耳 2022-11-28 10:18:32
:^(
強力飲水 2022-11-28 10:18:57
:^(
媽咪做社工 2022-11-28 10:45:10
:^(

Ads

媽咪做社工 2022-11-28 11:04:42
:^(
手一黏便緊(UTC+9 2022-11-28 11:13:46 再嘈偷埋你份工
強力飲水 2022-11-28 11:19:51
:^(
MIDE-823 2022-11-28 11:46:43
:^(