I am writing this program for class and it compiles fine but when i debug it it gives me an assertion failure any suggestions would be welcomed i need it to output 20 random sentences.
#include "stdafx.h"
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <cctype>
using namespace std;
const char SIZE = 100;
int _tmain(int argc, _TCHAR* argv[])
{
const char *article[5] = {"the", "a", "one", "some", "any"};
const char *noun[5] = {"boy", "girl", "dog", "town", "truck"};
const char *verb[5] = {"drove", "jumped", "ran", "walked", "flew"};
const char *preposition[5] = {"to", "from", "over", "under", "on"};
char sentance[40];
int i = 0;
srand((unsigned)time(NULL));
for( i = 0; i <= 20; i++)
{
strcat_s(sentance, article[rand()%5]);
strcat_s(sentance,noun[rand()%5]);
strcat_s(sentance,verb[rand()%5]);
strcat_s(sentance,preposition[rand()%5]);
strcat_s(sentance,article[rand()%5]);
printf("\n\n%s\n\n'", sentance);
}
return 0;
}