Category : c++

[EDIT: I went through relevant questions on Stackoverflow, but they weren’t helpful.] I was thinking about writing an algorithm (a graph traversal algorithm) to determine the order of execution of the constructors in a given class-hierarchy (in C++). This is how I was modelling the problem: I am assuming there is only a default constructor ..

Read more

I am working on a project where I have to write to an read from a serial port. I have written the following code, but I am getting the message "can’t open the port" in my else statement. When I use hercules, I can open the "COM1" port. But I don’t know why can’t I ..

Read more

I am producing a HTTP response from an Qt 5.15.2 application, the response is typically something like: HTTP/1.1 200 OK Server: XMLMPAM Access-Control-Allow-Origin: * Date: Sun, 24 Jan 2021 07:56:45 GMT Content-Length: 65 Connection: Closed Content-Type: text/html; charset=utf-8 <!DOCTYPE html><html><body>{%22msgType%22:%22hb%22}</body></html> Here is the code that produces this: static const QString scstrLineTerm("rn"); QString strWrapper("<!DOCTYPE html><html><body>" + ..

Read more