I started with JS about 10 years ago and I fell in love with it (even though it can be weird 😅). I had step backs in my career that ended up being good. Currently I'm a passionate front-end developer.
/* copy string into buffer */voidstrcpy(char*dst,char*src){while(*src)*dst++=*src++;}
It's equivalent to:
voidstrcpy(char*dst,char*src){while(*src){/* while src isn't pointing to nul character (terminator) */*dst=*src;/* copy the char at 'src' to char at 'dst' (both pointers) */src+=1;/* increment src pointer to next char */dst+=1;/* increment dst pointer to next char */}}
It's really not something to make a habit of but in this specific context, C string copying, it's a common idiom.
I started with JS about 10 years ago and I fell in love with it (even though it can be weird 😅). I had step backs in my career that ended up being good. Currently I'm a passionate front-end developer.
Fair enough! I learnt it years ago downporting a little C++ game for practice and finding that it forced me to write simpler and more to-the-point code. Essentially: data-oriented programming. Those concepts are useful in other languages too!
I started with JS about 10 years ago and I fell in love with it (even though it can be weird 😅). I had step backs in my career that ended up being good. Currently I'm a passionate front-end developer.
What it does??
It's a string-copying idom in C. Full context:
It's equivalent to:
It's really not something to make a habit of but in this specific context, C string copying, it's a common idiom.
See also sjmulder.nl/2023/casey-interview-2...
Haha, I don't think I'll be learning C in this life, but I'm surprised by people who have the strength to learn it. Kudos.
Fair enough! I learnt it years ago downporting a little C++ game for practice and finding that it forced me to write simpler and more to-the-point code. Essentially: data-oriented programming. Those concepts are useful in other languages too!
Great! If you know C I would bet that you know a few other languages.