Up until this point, my program works flawlessly. But upon reaching the following piece of code, it errors out, giving me a RAV.
char Intermediary[121] = "nnbyonnnnyonnnnyognnbynnnnnyngnrbynnnrnynnnrnyngnnbnonnnnnognrbnnnnrnnngwnbnonwnnnonwnnnogwnbnnnwnnnngwrbnnnwrnnnnwrnnng";
char* result[1024] = { "" };
for (i = 0; i < 120; i++)
{
if (strchr(Intermediary[i], "y") && strchr(Intermediary[i], "b") && strchr(Intermediary[i], "o"))
//Conditions passes, set result
concat(result, Intermediary[i]);
else
{
break;
}
}
if (i == 120)
{
// No condition passed: throw an error
printf("Error: Condition failed :(\n");
exit(1);
}
printf("%s", result);
getchar();
return 0;
The code for concat can be found here, posted by David Heffernan: How do I concatenate two strings in C?
Thank you in advance :)