fork(28) download
  1. #include <iostream>
  2.  
  3. constexpr bool strings_equal(char const * a, char const * b) {
  4. return *a == *b && (*a == '\0' || strings_equal(a + 1, b + 1));
  5. }
  6.  
  7. int main() {
  8. static_assert( strings_equal("abc", "abc" ), "strings are equal");
  9. static_assert(!strings_equal("abc", "abcd"), "strings are not equal");
  10. return 0;
  11. }
Success #stdin #stdout 0s 3336KB
stdin
Standard input is empty
stdout
Standard output is empty