I wanted to go over some of my favourite surprising and obscure facts about C. We start with the essentials you really ought to know, like pointers, the stack, and the heap, before diving into the deeper and weirder stuff—like why a byte isn’t always 8 bits. It’s an iceberg video!
This is a great watch for anybody interested in systems programming, low-level development, or just wanting to understand the quirks that have shaped modern operating systems and programming languages.
0:00 Intro
0:31 Pointers
0:56 Arrays are (not) pointers
2:00 The stack
2:40 The heap
3:12 Struct alignment
4:19 Crazy compiler optimizations
5:19 Bitwise operations on signed types
5:56 Unsafe behaviour in the C standard library
6:23 Digraphs and trigraphs
7:01 main is not _start
7:33 A byte is not 8 bits
8:14 Don’t start a number with 0
source

4:40 no… I don’t think so. I think if i is given it might unroll the loop but i doubt it can „figure out“ sth like that.
Great video. I've been writing C code for over 40 years and didn't know about memory alignment in structs or the _start function. Thank you. An old dog can learn new tricks!
in a for loop, i++ and ++i is the same, but ++i is better
Very enjoyable. I used to be a C programmer in the late 1980's but still recalled the notation used here! Great fun. In the end, I found it easier to write programs that worked correctly quicker in Pascal – just because the type checking was so much tighter!
Why did I even watch this, I don't even know how to program
Some C++ compilers are now implemented in C++..
Also, way back around 1990 I learned C++ on a 286 running System V (release 2) UNIX. There was something called "cfront" that took C++ code and converted it over to C code, and that was fed to the existing C compiler.
3:10 memory leak😂 sound
About the "byte not 8 bits" part:
It's pure legacy, before intel 8080 and microprocessor market boom mainframes had bytes of various sizes ( 6, 8, 9, 12…)
Great video. My only note is that the pointer decoration belongs with the variable name, not the type. "int*" is attractive as meaning "pointer to int", but int* p, q; does not declare two pointers, so I always put the * with the variable name to avoid confusion. The idea of sticking the decorator on the type was popularized by Bjarne Stroustrup with his C++ book. Parenthetically, the same thing is true of the reference decorator & in C++: int n = 7; int& r(n), s(n); declares r as a reference (to n) and s as an int (with the value 7).
You really have a very diverse knowledge, even though you are pursuing Msc in different field you have a profound knowledge of Cs and so much insights
man i forgot how i loved c
My favourite C fact: Learning C isn't truly learning how "your computer works". You're learning how the C Abstract Machine, which is based on the PDP-11, works. Technically, C runs inside a Virtual Machine, but one withough garbage collection.
Google for: "Beyond the PDP-11: Architectural support for a memory-safe C abstract machine" you should get a link to Cambridge University. There's other links, good terms to search for are "C Abstract Machine PDP-11"
When I started programming, before the introduction of c, there were hardware architectures that had 9 bit bytes. I never personally used such a system, but they were out there.
question:
If C has Inline Assembly, pointers (and pointer arithmethic)
Is it really a high level language?
And
Fortran was the first high level language, released in 1957 (compare that to 1972 for C (and 1989 for the ANSI C version)
care. char. car. chair. the eternal debate
So hard to find videos about C that teach anything about the language instead of just talking of the language or how it relates/differs to other languages. Though not a tutorial it was generally quite clear and educational. Thank you.
Banger, but one thing most of the time the stack goes down and the heap grows up, other than that nice video.
Iceberg? More like ice cube *grumpy old neckbeard.
Stack grows downwards.
8:28 Those people are just stupid, lol