正在加载视频...

视频加载失败

Dynamic Arrays in C

646,015 次观看 • 2 年前 •via X (Twitter)

7 条评论

Тsфdiиg 的头像
Тsфdiиg2 年前

The presented in the video code is not meant to be production ready. It's meant to convey the main idea of the approach. You actually want to pass xs by pointer and wrap it internally in parenthesis. I've put a better version in a gist:

Тsфdiиg 的头像
Тsфdiиg2 年前

Just 9 lines of code?

Kolt 的头像
Kolt2 年前

I believe this is how vectors work in C++?

Тsфdiиg 的头像
Тsфdiиg2 年前

Yes

Vjekoslav Krajačić 的头像
Vjekoslav Krajačić2 年前

But creating a new struct for each type! Surely, that makes you an unproductive programmer! /s

LLLL Colonq (man of letters) 的头像
LLLL Colonq (man of letters)2 年前

this is a nice video format, it's fast but the order of things flows very well

Qianqian Fang /房骞骞/ 的头像
Qianqian Fang /房骞骞/2 年前

in the macro, what does "do{}while(0)" provide compared to just a pair of curly brackets {...}?

相关视频