Click here to Skip to main content
15,915,828 members

Comments by k5054 (Top 200 by date)

k5054 5 days ago View    
Go back and re-read my solution. In particular pay attention to the call to TRACE_Function when wanting to use QTextEdit::append
I've reformatted that part to make things a little more clear
k5054 22-May-24 12:23pm View    
1: I think maybe you replied at the wrong place, and this should be a reply to one of the solutions, below
2: If this is a static string, why go through the work of extracting things later? Why not just create your extracted objects at the get go? Seems like unnecessary work to me, with the added possibility of having to debug later. Creating the aggregate string from those objects shouldn't pose too much difficulty.
k5054 22-May-24 12:15pm View    
My 5.
I always forget about raw string literals. :(
k5054 22-May-24 11:59am View    
White space is acceptable when concatenating a string constant, so you can remove the trailing \, and to OP probably wants a trailing newline (\n) as well. Perhaps even some initial spaces too.

To the OP: multi line string constants are not valid in C/C++.
k5054 16-May-24 11:52am View    
Pete's function has a bug. file.eof() only returns true after a read is attempted beyond the end of the file. Instead of if ( file.eof() ) { try if ( file.peek() == EOF) {