Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

You cannot add to a void pointer in C. The compiler does not know the size. The everyday fix is to cast it to char* so the math is in bytes, then multiply by the element size yourself. Stanford CS107, lecture 4

28,004 Aufrufe • vor 2 Monaten •via X (Twitter)

15 Kommentare

Profilbild von acidburn
acidburnvor 2 Monaten

this is what matters

Profilbild von Jack
Jackvor 2 Monaten

You shouldn’t be using void pointers in the first place.

Profilbild von Ray Epps
Ray Eppsvor 2 Monaten

there was a time when i was addicted to the stanford and harvard cs class recordings

Profilbild von JETLAB-X
JETLAB-Xvor 2 Monaten

Good Lord… flashback nightmares… I despised Object C/C++ glad XCode lets me do stuff with Swift.

Profilbild von BullBear.News
BullBear.Newsvor 2 Monaten

Nothing like realizing at 2 AM that your pointer arithmetic on a void star just silently broke on ARM because the ABI handles things differently.

Profilbild von Adrien Chauvet
Adrien Chauvetvor 2 Monaten

Thank God, with AI it's becoming increasingly possible to create software without having to struggle with such hieroglyphs.

Profilbild von symbols
symbolsvor 2 Monaten

I am self taught and felt like an imposter for all the 15years until I watched this lecture, then I saw my true mind.

Profilbild von Chris Ziomkowski
Chris Ziomkowskivor 2 Monaten

I worked on a custom architecture that didn't have byte addressing, so char* was the same as int*. Assuming char* is only 1 byte wide is a very bad idea. You should cast void* to uint64_t and do your work as integers if you want it to be portable.

Profilbild von Deepak
Deepakvor 2 Monaten

hmm interesting.

Profilbild von Gustavo Rocambóli
Gustavo Rocambólivor 2 Monaten

2026 bro no one cares anymore

Profilbild von 音GATO
音GATOvor 2 Monaten

void pointers, the real polymorphism

Profilbild von ᴅ ᴇ ᴀ ᴅ ʙ ᴏ ʏ
ᴅ ᴇ ᴀ ᴅ ʙ ᴏ ʏvor 2 Monaten

Boy, you don’t want my ass multiplying.

Profilbild von Mēgan DeMarco
Mēgan DeMarcovor 2 Monaten

No comprehend lol I actually don't know what you mean by this one explain please

Profilbild von Pitchfork & Torch ♞
Pitchfork & Torch ♞vor 2 Monaten

void* can’t count. We measure in chars!

Profilbild von Clank
Clankvor 2 Monaten

Wow even more basic shit information will it ever stop thank you

Ähnliche Videos

CSS Trick! 🤙 You can create gradient borders on translucent elements using mask-clip and mask-composite with a pseudo-element 🔥 .gradient-border::after { mask-clip: padding-box, border-box; mask-composite: intersect; mask: linear-gradient(transparent, transparent), linear-gradient(white, white); } It's the same "Transparent border trick" from before. But, now you apply it to a pseudo-element 😎 The trick is to create a pseudo-element with a gradient background and then mask it so we only see the part we want, the border ✨ mask-clip defines the area affected by a mask. Similar to how you can define background-size. Using padding-box and border-box constrains the two masks. mask-composite is the magic part ✨ It defines a compositing operation for stacked mask layers. Using intersect means that the parts that overlap get replaced. And this seems to work in all browsers 🙌 As for the rest of the styles... – Make sure you set pointer-events: none on the pseudo-element – Make sure it fills the parent element. You can use position: absolute and inset: 0 – Make sure the background fills the space including the border-width. You can use calc to achieve that: --bg-size: calc(100% + (2px * var(--border))); background: var(--gradient) center center / var(--bg-size) var(--bg-size); That's it! 🚀 Gradient borders on translucent elements. You can set all the backdrop-filter: blur() you like! 😅 CodePen.IO link below! 👇

jhey ʕ•ᴥ•ʔ

269,966 Aufrufe • vor 3 Jahren