crack a cipher with string arrays

This is a discussion on crack a cipher with string arrays within the C++ Programming forums, part of the General Programming Boards category; hey guys, I have the assignment to build a program to decode a cryptogram puzzle using provided word tables. for ...

crack a cipher with string arrays

hey guys, I have the assignment to build a program to decode a cryptogram puzzle using provided word tables. for each table the program should print the decoded text generated by that table and the number of actual english words in the decoded text. the encoded text is in the file crypt.txt and its less than 80 characters. the codetables are in codetables.txt and each line contains a tablein the form of an ASCII string and the program should process however many tables there are. the file dict.txt contains the dictionary which the program should use to determine word validity.

I had the program set up to save each table then test all of them at once but decided to change it to read in a table then test it immediatly and output then move onto the next table. but on restructuring it I keep getting logic errors.

please take a look at my code and see what you think, also let me know if you have tips on how I could structure this better.
thanks, i'd appreciate all the help i can get

The thing you're compiling and the thing you've posted are not the same thing. For instance, line 91 is

Code:

testTable (table, decrypt, crypt);

which doesn't have any conversion to string in it anywhere. What it does have is a completely unknown variable "crypt". Same with all your other lines -- they're all on the lines with testTable on them, but you must have changed them since you compiled since the error messages indicate something like table = testTable(decrypt, crypt) or something.

thanks guys, I made some changes, got rid of decrypt and now just call get crypt in a loop to reset it, and a few other things. The codetables come in and output correctly but there seems to be a problem with the letter switch in test table and find position. because all the decrypted code comes out the same. Once again I'd appreciate some tips. thanks any tips help a bunch.heres the new improved code