Click here to Skip to main content
15,917,321 members

Comments by Daniel Pfeffer (Top 44 by date)

Daniel Pfeffer 22-Mar-23 5:38am View    
make sure you are calling !empty(), rather than empty().
Daniel Pfeffer 21-Feb-23 9:31am View    
This works, but is unnecessary. I assume from the name of the function merge_sorted() that vec1 and vec2 are already sorted. In that case, std::merge() is much more efficient. See solution 2 above.
Daniel Pfeffer 21-Feb-23 9:28am View    
Others have given solutions to the problem which work nicely. I would point out an inefficiency in your code - passing vec1 and vec2 by value. Passing them by const reference saves the copy (and additional memory usage).
Daniel Pfeffer 26-Dec-22 14:36pm View    
Chess engines have been written in many languages, the choice of language being determined more by the environment than anything else. If one wishes to have a program that runs in a browser, that limits one to the languages and frameworks available in a browser. If one wishes to have a program that runs on a desktop the choice of languages is wider, but it will run only in the target O/S.
Daniel Pfeffer 25-Dec-22 13:14pm View    
There is a publicly available program, ghidra, produced by the NSA (of all places!) that can do a fairly decent job of converting an object (.o) file to C. To download it, you need to use a VPN that identifies you as being in the US, but there are no other restrictions on the download.

Decompilation is an iterative process - you identify parts of the code / data, and then modify a configuration file so the program will take your identification into account, and repeat.