Menu
Coddy logo textTech

Compare two Strings

Lesson 9 of 18 in Coddy's Functions in C++: Building Your Own Functions course.

challenge icon

Challenge

Easy

Write a function to compare two strings.


The function compare_string is a function that takes two strings and returns true if they are equal and false if not.

Example:

  • If the input is "Hello" and “hello”.
  • The output will be false.
     

Try it yourself

#include <iostream>
#include <string>
using namespace std;

bool compareStrings() {

}

All lessons in Functions in C++: Building Your Own Functions