1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
char *alphabet[] = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "y", "x", "z"};
^
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp:4:149: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
main.cpp: In function 'std::__cxx11::string encrypt(std::__cxx11::string)':
main.cpp:22:55: error: could not convert 'unencryptedPhrase.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))' from '__gnu_cxx::__alloc_traits<std::allocator<char> >::value_type {aka char}' to 'std::__cxx11::string {aka std::__cxx11::basic_string<char>}'
int index = findAlphabetIndex(unencryptedPhrase[i])
^
main.cpp:24:8: error: 'encryptedIndex' was not declared in this scope
if(encryptedIndex >= 26)
^~~~~~~~~~~~~~
main.cpp:24:8: note: suggested alternative: 'encryptedPhrase'
if(encryptedIndex >= 26)
^~~~~~~~~~~~~~
encryptedPhrase
main.cpp:28:33: error: 'encryptedIndex' was not declared in this scope
encryptedPhrase += alphabet[encryptedIndex];
^~~~~~~~~~~~~~
main.cpp:28:33: note: suggested alternative: 'encryptedPhrase'
encryptedPhrase += alphabet[encryptedIndex];
^~~~~~~~~~~~~~
encryptedPhrase
exit status 1
|