210
Deltarule (lemmy.world)
submitted 2 weeks ago by Stamau123@lemmy.world to c/196
you are viewing a single comment's thread
view the rest of the comments
[-] zea_64 3 points 2 weeks ago

const is more like C++ constexpr, but static is similar to static from C: it's a variable that lives outside any scope. Of course, that means the same static can be accessed by multiple threads, so writing to a static is unsafe (except for types like Mutex, you can safely use those to write, but your static won't be declared mut)

this post was submitted on 02 Oct 2024
210 points (100.0% liked)

196

16363 readers
1923 users here now

Be sure to follow the rule before you head out.

Rule: You must post before you leave.

^other^ ^rules^

founded 1 year ago
MODERATORS