I was wondering what is the best way to interpret “bit string”?
for example:
a bit string like “1010010” is feed to the following function
void foo (string s1) {
// some code to do bit manipulation of the bit string
}
What is the best way to do it? Many thanks!!!
If you just want to convert string into its integral value, then
std::stoifamily could help:If you want to manipulate bit patterns represented by string, then
std::bitsetmight help you in some way: