Im trying to create a code program but am being stopped because Xcode will not let me use the line length=word.length.The error message is Implicit conversion loses integer precision: 'size_type' (aka 'unsigned long') to 'int'. The line of code is
string Encode(string word) {
int length = word.length();
string theSum = "";
for (int i = 0; i < length; i++) {
if (theSum[i] == 'a') {
word += 1-1;
}
There is more, but it is really long. The same error is occuring with all my lines of code with the words 'length=word.length. Please advise! All help is welcome.