My new C programming book is slowly taking shape. If you want to learn along, let's start with the basics of control flow:
http://godbolt.org/z/3GerY3zEc
1/5
=> More informations about this toot | More toots from lcamtuf@infosec.exchange
From there, we can progress to function definitions and lexical scopes:
https://godbolt.org/z/GevPGhnYc
2/5
=> More informations about this toot | More toots from lcamtuf@infosec.exchange
Of course, no C tutorial is complete without an explanation of basic loops:
3/5
=> View attached media | View attached media
=> More informations about this toot | More toots from lcamtuf@infosec.exchange
It is also important to understand switch() statements:
https://godbolt.org/z/MqGb63x69
4/5
=> More informations about this toot | More toots from lcamtuf@infosec.exchange
But the most convenient feature of C is line numbering:
https://godbolt.org/z/dfsKGqYGz
5/5
=> More informations about this toot | More toots from lcamtuf@infosec.exchange
@lcamtuf The more I stare at this code, the more I think I actually hate you. I mean, in a good way, but still. 😉
=> More informations about this toot | More toots from tekhedd@byteheaven.net
@lcamtuf@infosec.exchange there is only one gif that can describe my reaction to this.
=> More informations about this toot | More toots from puppygirlhornypost2@transfem.social
@puppygirlhornypost2 @lcamtuf wait, this is intended to be confusing and worrisome? I thought this was originally a genuine approach to C programming :sobbing:
=> More informations about this toot | More toots from mondanzo@wolfdo.gg
@lcamtuf The second example is clear enough. But the first, uh, gcc's hand-crafted parser clowns the standard committee yet again.
💯 for "using" the function and avoiding the warning.
=> More informations about this toot | More toots from drahflow@infosec.exchange
@lcamtuf subtitle of your book "C for perl coders"? ;)
And as a bonus for the first 42 copies you get a little spray bottle of bleach to apply gently to your eyes? ;)
=> More informations about this toot | More toots from jeroen@secluded.ch
@lcamtuf I have a feeling, a feeling that something is wrong, very wrong, around this area :thonking:
=> More informations about this toot | More toots from vascorsd@mastodon.social
@lcamtuf Can I get a printed version ... not sure whether I want to burn it or frame it. 😂
Reminds me of Scala workshop I attended. The instructur started with showing off how beautiful Scala code could be and without commenting on it at all, the code on his slides just got progressively more uggly until it reached a similar level of cursed. 😬
=> More informations about this toot | More toots from gilgwath@social.tchncs.de
@lcamtuf I THOUGHT I KNEW C, DAMMIT! o.O
=> More informations about this toot | More toots from nothe@notacult.social
@lcamtuf surely your book is at least approximately rectangular?
=> More informations about this toot | More toots from kauer@aus.social
@lcamtuf This is the type of shitpost one can only find on the fediverse
=> More informations about this toot | More toots from kallisti@infosec.exchange
@lcamtuf C sucks.
=> More informations about this toot | More toots from Dianora@ottawa.place
@lcamtuf TIL about zombo.com
=> More informations about this toot | More toots from eloy@hsnl.social
@lcamtuf oh god i spent like 5 minutes trying to figure out where this syntax to override function symbols was defined before realizing it wasn't different from the "normal" syntax
=> More informations about this toot | More toots from leo@60228.dev This content has been proxied by September (3851b).Proxy Information
text/gemini