that's easy enough for searching in one array but it's harder with parallel arrays. you need to keep track of the number of words and then do the same thing on the parallel array for the same number of words.
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SEARCHWORD "word2"
int main()
{
char str1[] = "word1 word2 word3 word4";
char str2[] = "reply1 reply2 reply3 reply4";
int i = 0, j = 0, k = 0;
for (i = 0;
str1[i] && strstr(str1, SEARCHWORD) != &str1[i];
i += strcspn(&str1[i], " ") + 1) j++;
if (str1[i])
{
while (j-- > 0) k += strcspn(&str2[k], " ") + 1;
printf("found starting at %s\n", &str2[k]);
}
return EXIT_SUCCESS;
}