1. Use code tags. See http://cplusplus.com/articles/z13hAqkS/ .
2. After you have edited your post to properly show the code with code tags, be sure to let us know the line number where the problem appears.
You see, I don't even read code posted without code tags and proper indentation, and probably many others as well. So help us help you. :D
This is better, yes. Find out the line number. Debug your code. Run the program one line at a time and witness the moment the segfault appears. Then you'll know exactly the line giving you a hard time.
Alright, I fixed those two errors, but it won't even print the first cout statement, it just goes to segmentation fault(core dumped). It wont even print a line before I initialize the hash vector, so am I using the vectors incorrectly.
Might be me, but I don't think your code should even be compiling properly... You're using vector<string>, but you haven't included the C++ string library, just the C-string one. Your need the string header, not string.h or cstring.
[edit]
for(i = 0; i < 23; i++) --> You only have 22 elements, at [0,21]. 22 is going to throw an out of bounds error. Same goes for lines 44, 95 & 96, which should be %22, not %23, and a loop to <22.
Alright, I edited my code with your help and it runs good. Thanks guys. But, it won't input the words into the string vector during the input function, so looking into that now.
Your also passing the vectors by value when you should pass a reference. The seg fault is due to the vector size being 22, make Gaminic's changes or change vector size to 23.
@bluecoder Why should he empty the vector?
EDIT: inthash = ( word[0] + word[length-1] ) % 23; You will probably gett alot of collisions with this hash. Most i've seen use XOR and a prime number.