Question
Write a function called isAnagram that takes two strings as arguments and returns a boolean true if the two strings are anagrams, otherwise it returns
Write a function called isAnagram that takes two strings as arguments and returns a boolean true if the two strings are anagrams, otherwise it returns false. Two strings are anagrams if the letters can be rearranged to form each other. You MUST use the C string library or string class functions to complete this code. (no sort functions)
MAKE SURE THE FUNCTION IS NOT CASE SENSITIVE AND SHOULD DISREGARD ANY PUNCTUATION OR SPACES.
#include
#include
#include
#include
using namespace std;
bool isAnagarm (string s1, string s2){
To test the code enter "Eleven plus two as string s1 and Twelve plus one as string s2. The function should return true. |
Rats and Mice as string s1 and in cats dream as string s2 should also return true.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started