Beej's guide to C programming, chapter 7: Strings

preview_player
Показать описание
Useful source + links for video sources

macOS video version

BEEJ book

Notion page with ~endless free good sources

Timeline
00:00:00 Intro
00:02:00 is char *s = "str" equal to char a[] = "str" ???
00:05:42 Initialization of a char array under the hood
Рекомендации по теме
Комментарии
Автор

at 00:07:42 let me be more precise
The string is stored in ROM and then memcpy is gonna copy the string from ROM ONTO THE STACK (I hope this was clear, but very often I imply too much, and explicit is better than implicit, one of the python credo here haha)
The memcpy thing is done for performance reasons.

onaecO
Автор

Such a great fucking video. Thank you for making great content. I’ve been watching your printf video as well. It would be interesting to see a printf implementation without the stdarg library.

chacho
Автор

Please can you help me I am a beginner++ in c and I am making my first lexer, I have 3 major problem, when at the end of the file a put a space, it doesn't skip the space, when i creat a new line I doesn't skip, and when the file is 25 letter long or plus when I print all the token I get some random characters and the correct token at the same time, thanks for doing videos, I love them

silloo
Автор

That's so cool! So does that also mean a pointer to a character is not the same as an array of characters, aka a string? It's so confusing when you extrapolate from "they can, most of the time, be used interchangeably" to "they are the same thing". Taking a step back, it almost sounds stupid, right? A char *s initializes a pointer and a char s[ ] initializes a random access, contiguous block of memory (i.e. an array)... duh!

JoaoJGabriel
Автор

Can I do 42 projects without being in 42 school just out of curiosity ? Like i found a bunch of small books about C and C++ related to 42 is that it ? Is there other sources ?

themadmen
join shbcf.ru