Someone on github https://github.com/analogdevicesinc/libiio/issues/287 asked:
I was trying to find a way to read an attribute as a C++ std::string, but could not find a way to either get the attribute length or read it sequentially (as a stream). It seems to be possible for at least network backend but this functionality is not exported in the library interface. Is it impossible to do for some backends or is it just considered unneeded?
Typically IIO attributes are NULL terminated strings.
I'm wondering if there's a C++ snippet you could provide that would highlight what you want to do?