fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5. const std::string& larger(const std::string& s1, const std::string& s2) {
  6. return s1 > s2? s1 : s2; // Return a reference to the larger string
  7. }
  8.  
  9. int main() {
  10. string a{"ala"}, b{"kala"};
  11. auto x = larger(a, b);
  12. return 0;
  13. }
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
Standard output is empty