Implementing std::vector but in C - NO TALKING - !ASMR Programming

preview_player
Показать описание
In this video, I am going to implement the C++ vector but in C programming language. This will help you in leaning the low level implementation of the std::vector in the Cpp programming language. I implemented the std::vector object just the way it is in the original std namespace of C++. Hope it helps :)

...

...

#programming
#tutorial
#forbeginners
#vector
#stdvector
Рекомендации по теме
Комментарии
Автор

*Correction!*
In 𝚜𝚑𝚛𝚒𝚗𝚔_𝚝𝚘_𝚏𝚒𝚝( ), the validation condition should be || (OR) not && (AND).

𝚒𝚏 (!𝚜𝚎𝚕𝚏->𝚂𝚒𝚣𝚎 || 𝚜𝚎𝚕𝚏->𝚂𝚒𝚣𝚎 == 𝚜𝚎𝚕𝚏->𝙲𝚊𝚙𝚊𝚌𝚒𝚝𝚢) 𝚛𝚎𝚝𝚞𝚛𝚗;

Because we are actually trying to see if the vector is 𝙯𝙚𝙧𝙤 𝙨𝙞𝙯𝙚𝙙 OR its 𝚂𝚒𝚣𝚎 and 𝙲𝚊𝚙𝚊𝚌𝚒𝚝𝚢 are equal then we there's no need to shrink.

najmiter
Автор

Some tips:
Instead of malloc on push_back and shrink_to_fit use realloc, so you don’t need to copy an entire section and to hold two allocations at the same time.
Don’t forget to check the pointer returned by malloc, and pointers passed by parameters

Fmmazur
Автор

i don't even know how to use the built-in and my man implemented from scratch and on top of that it's IN C 👏

DARKYT
Автор

for Non-Hindi fellas, the variable 'pkr_mery_ko' means 'hold me' in Hindi 😅

Lizzzzzz
Автор

Made the same thing out of boredom, just with an addition of some type specification using some macros, like: VECTOR_CREATE(&list, int)
Good video!

DrSTAHP
Автор

Hey, I would recommend that you don't use keyboard sound emulation, if it doesn't fit exactly your typing. Some does, but this one doesn't, and in that case it's juste triggering and quite hard to listen to if the sound is not following the video.
I would have preferred no keyboard background if you could not have included your keyboard, I watched the video with the sound off. Nice vid though

orko
Автор

In C you don't need to cast a void pointer, like you do in malloc.

Akn
Автор

How about investing into a microphone?

jabuci
Автор

type \*identifier gives me PTSD. Should be type\* identifier. Being a pointer is an attribute of the type, not the identifier.

godDIEmanLIVE
Автор

I clicked for some cool ASMR key clicking and I'm very disappointed.