1

Using C11 I'm looking to fetch the contents of a char* atomically, and was wondering what the best way to go about doing that was. I've defined a variable like so: _Atomic char* str;, but attempting to load the value atomic_load(&str); results in a compiler error Address argument to atomic operation must be a pointer to _Atomic type ('_Atomic(char) **' invalid)

I'm aware that C11's Atomic implementation allows for the declaration of Atomic char's, but how do I go about dealing with malloc'd char* pointers?

4

0 回答 0