Any C devs catch a silly mistake here? Seems like it should work? https://stackoverflow.com/questions/45268988/return-a-struct-with-string-from-a-multi-threaded-rpc-server …
Turns out `sizeof("foo")` is the same as `strlen("foo") + 1`. A pointer is 8 bytes not 4
-
-
Wait, what? Did that change? That didn't used to be true...
-
Looks like it's always been that way as far as I can tell. We're just bad at C lol
- 11 more replies
New conversation -
-
-
printf("sizeof of bigger than foo: '%zu'\n", sizeof("bigger than foo")); sizeof of bigger than foo: '16'
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.