Converting bool to text in C++

How about using the C++ language itself? UPDATE: If you want more than 4 lines of code without any console output, please go to cppreference.com’s page talking about std::boolalpha and std::noboolalpha which shows you the console output and explains more about the API. Additionally using std::boolalpha will modify the global state of std::cout, you may want to restore the original behavior go here for … Read more

Java says this method has a constructor name

You can’t use the class name as the name for a method. The only “methods” that can share a name with the class are constructors. One fix would be to rename your class from isPalindrome to PalindromeFinder or something. That would also better align with Java naming conventions. EDIT: Note that you never actually called your method in main; … Read more

Fastest way to generate a random boolean

The first option – rand.Next(2) executes behind the scenes the following code: and for the second option – rand.NextDouble(): Since the first option contains maxValue validation, multiplication and casting, the second option is probably faster.