Category : buffer

I’m having a fairly large amount of data (>1MB) encoded in Base64. I found a nice library which can help me dealing with this as fast as possible. It’s decode syntax is here, very basic, it needs an output buffer: int base64_decode ( const char *src , size_t srclen , char *out , size_t *outlen ..

Read more

I have read in many places that clog is the same as cerr, except that clog is buffered and cerr is not. But I cannot see this behavior on my computer (Ubuntu 20.04, clang 9). Here is the code I use: clog << "AA"; this_thread::sleep_for(chrono::seconds(3)); clog << endl; clog << "BB" << endl; When I ..

Read more

I am trying to convert a char buffer into multiple int variables. This is what i got so far after a day of trying. ZeroMemory(buf, 4096); int bytesReceived = recv(sock, buf, 4096, 0); if (bytesReceived > 0) { /*for (int i = 0; i < bytesReceived; i++) { cout << hex << (int)buf[i]; }*/ std::stringstream ..

Read more