![]() |
TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
A class to perform binary addition of two binary strings. More...
Public Member Functions | |
| std::string | addBinary (const std::string &a, const std::string &b) |
| Adds two binary strings and returns the result as a binary string. | |
Private Member Functions | |
| bool | isValidBinaryString (const std::string &str) const |
| Validates whether a string contains only binary characters (0 or 1). | |
A class to perform binary addition of two binary strings.
Definition at line 31 of file binary_addition.cpp.
|
inline |
Adds two binary strings and returns the result as a binary string.
| a | The first binary string. |
| b | The second binary string. |
Definition at line 40 of file binary_addition.cpp.
|
inlineprivate |
Validates whether a string contains only binary characters (0 or 1).
| str | The string to validate. |
Definition at line 75 of file binary_addition.cpp.