So, I wanted to make a genetic algorithm, using binary for the genes (1 if the gene is activated, 0 if not), so I wanted to know if there's a way to store a integer as binary in a variable by using some c++ function, so I don't have to write one function to convert decimal numbers to binary numbers...
If the number of binary digit is fixed you can use std::bitset ( It has interfaces to convert is to/from strings and longs )
Or you can keep the integer as it is and use the bitwise operators to get/set values of specific bits.