There are MANY problems with you code i'm just gonna post a few to get you started with something to sort out.
My first comment is that you should be using #include <ctime>
rather than time.h
number 2:
char* getMessage(const int messageId)
{
return messages[messageId].c_str();
}
You have not defined messages...i suggest you do something about that.
number 3:
string theArray[2];
theArray[3] = END_OF_ARRAY;
theArray[3] doesn't exsist...yu declare and array of size 2 giving you elements 0..1 then you try and access number 3...not possible its an out of range error and is not safe.
Since his is a double problem here is part 2. END_OF_ARRAY is no definded within this scope thus you cannot use it here.
number 4:
for(c = 4; c <=100; c++)
{
srand((unsigned)time(NULL)); // Set a seed for random-num Generator.
a = (rand() % 100) +1;
}
You only need to seed rand() once in your program not 97 times. Also what is the point in generating 97 random numbers when it is only the final one that you will actually use!
And last one is not so much a problem just will help you and everyone else understand what is going on.
Use good descriptive variables names...rather than things like a b c str1 which mean nothing to anybody.
Chris