Hi, how could I set width amount of bits in an integer starting from bit lsb going to the left to 1? For example width = 32 and lsb = 16 should result in 0b0000000000000000111...
how do I overload macros?
How do I convert this: struct color { unsigned char alpha; unsigned char red; unsigned char green; unsigned char blue; }; to an int in C++?
Is there any reason why people do that? if (lasta == 0) { }; if (lasta == 1) { Prl += 1; }; if (lasta == 2) { P...
how do I create a void* but as shared_ptr?
How do I definitely make my program fault?
Hi, how do I check if a command exists on host?
How do I detect if an integer has under- or overflowed?
std::string str = "ntoo"; auto res = str.find('o'); if (res != str.npos) { str.erase(res); } Hi, any idea why this std::string::erase erases both 'o' characters instead of...
Hey, why does this: int main() { auto x = new int(8); cout << *x << endl; delete x; auto y = new int(7); cout << *x << endl; *x = 3; cout << *x << ...
template<typename T> const T* memmem(const T* f, size_t f_len, const T* s, size_t s_len) { for (size_t idx = 0; idx != f_len-s_len; idx++) { if (memcmp(f + idx, s,...
how do I return current rax register value?
struct Variable { enum Type { id_string, id_integer, id_reference } type; union Data { std::string string; int32_t integer...
std::string read_from_client(int filedes) { char buffer[1024]; int nbytes; // Read from client nbytes = read(filedes, buffer, 1024); // Check for error ...
/home/nils/Programme/OSS/dclirc/structs.hh:76: Error: passing ‘const user_struct’ as ‘this’ argument discards qualifiers [-fpermissive] 76 | res = member.receiv...
any idea why following won't work… enum permissions { ban_members, remove_members, change_name, change_perms, delete_content, invite_users, send_co...
what exactly does that indicate?
std::optional has an operator *, right?
Hi, how do I set/get the stack pointer in C++?
/home/nils/Programme/OSS/dclirc/connection.hh:22: Fehler: invalid static_cast from type ‘std::bitset<1024>*’ to type ‘fd_set*’ 22 | if (select(fdnum, static_cas...