ThreadSky
About ThreadSky
Log In
tsoding.bsky.social
•
119 days ago
This is my implementation of the `echo` command.
Comments
Log in
with your Bluesky account to leave a comment
[–]
chardoncs.dev
•
119 days ago
`argc > 0 && printf(" ")` is genius
2
reply
[–]
livetalk.bsky.social
•
119 days ago
Being rusty in C is, when you look at *(argv)++ and aren't sure about the operator precedence anymore..
3
1
reply
[–]
anka213.bsky.social
•
118 days ago
those parentheses can’t possibly do anything, right?
0
2
reply
[–]
413x1nkp.bsky.social
•
118 days ago
oh, and also - the reason why parameters for macros-functions are often put inside parenthesis is for cases like this:
1
1
reply
[–]
anka213.bsky.social
•
117 days ago
oh, right! i didn’t consider that it was the parameter of a macro and not a normal parameter! yeah, in that case it’s very sensible!
1
reply
[–]
413x1nkp.bsky.social
•
118 days ago
yeah
you could also do (*argv)++ and it'd yield the same results
the dereference has higher priority than increment, and is applied first
1
reply
[–]
tsoding.bsky.social
•
119 days ago
Found a bug sorry
39
1
reply
[–]
saltvt.dev
•
119 days ago
🤣 the classic
3
reply
[–]
cipherwave.bsky.social
•
119 days ago
printf $@
works for me
0
reply
[–]
nopnop.bsky.social
•
119 days ago
Add -n support and you got a perfect implementation 😃
0
reply
Posting Rules
Be respectful to others
No spam or self-promotion
Stay on topic
Follow Bluesky's terms of service
×
Reply
Post Reply
Comments
you could also do (*argv)++ and it'd yield the same results
the dereference has higher priority than increment, and is applied first
works for me