Skip to content

Tag: c++

How can I stop the while?

I have A TCP Server-Client where I enter a number with the number of times that I want to send the word to the server. So I send correctly because I print the information on a loop(in client) but in the server shows infinitely because I put while(1) but if I don’t use just print it one time. I don&#8217…

What is “(void*)-1” in the context of sbrk’s return value?

The Linux Man Page for sbrk() states that upon failure, it returns (void*) -1. What is (void*) -1 and does it have any significance or is it simply a number that could never actually be a void* which is cast to a void* just to meet the function signature of returning a void*? I ask this because I’ve nev…

How to get supported display refresh rates on Linux?

drmModeModeInfo structure from DRM contains uint32_t vrefresh; field, and the values are actually good there i.e. I’m getting 24-75Hz for different video modes. But refresh rates aren’t integers, they’re rational numbers, right now for my display the value is 59997/1000. Is it possible to get the precise numb…