C++ Caesar's Cipher

I'm currently working on a Caesar's cipher program. I am stuck because I do not know how to access the elements inside the const char 2d array that was given in the header file. I tried a for loop:
for( int i = 0 ; i < 10 ; i++ )
for( int j = 0 ; i < 60 ; j++ )
if cipher[i][j] != " "
Word += cipher[i][j] ;

When trying to compile, I get an error stating: "ISO C++ forbids comparison between pointer and integer"

And also: "incompatible types in assignment of 'const char' to 'char[60]'

And help would be appreciated.



closed account (48T7M4Gy)
Sounds like you need to concatenate using strcat() instead of '+'

http://www.cplusplus.com/reference/cstring/strcat/?kw=strcat
Last edited on
Topic archived. No new replies allowed.