convert binary string to int c++

#include <iostream>
#include <bitset>
#include <string>

int main() {
    std::string binaryString = "1010101";
    int decimalValue = std::bitset<8>(binaryString).to_ulong();

    std::cout << "Binary string " << binaryString << " is equivalent to decimal value " << decimalValue << std::endl;

    return 0;
}