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 …
-
-
Replying to @schneems
`malloc(sizeof("foo"))` isn't doing what you think it's doing. (That shouldn't be causing the segfault though)
1 reply 0 retweets 1 like -
Replying to @sgrif
sizeof("foo") returns 4, which seems right (3 chars + 1 null)
3 replies 0 retweets 0 likes -
-
Right, you can sizeof(“foo”) because it’s a const char* which means the compiler can determine how big it is at compile time.
1 reply 0 retweets 0 likes
`const char *x = "foo"; sizeof(x)` is different. Very C thing to make those behave differently. >_>
7:36 AM - 24 Jul 2017
from Ottawa - Gatineau
0 replies
0 retweets
0 likes
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.