here is my code. i am trying to write a simple program in which when the user's input is "monkey", my function adds the word "bars" to it. here is the code.
#include <stdafx.h>
using namespace std;
int List(char word[250]);
int main()
{
char word[250];
cout << "Please enter the word 'Monkey': ";
cin >> word;
List(word);
cout << "Here's the added suffix: " << word << "\n";
return 0;
}
int List(char word[250] )
{
if (word == "monkey" || word == "Monkey")
{
word = strcat(word , "Bars");
}
return 0;
}
the program runs, but does not add "Bars". what is the problem