#include #include #include int main() { char line1[] = "A simple line of text. "; char line2[] = "Flann O'Brien: At-Swim-Two-Birds. "; char line3[] = "Queens Park Rangers (QPR) FC."; char * total;char * t1;char * t2; int l1 , l2 , l3 , t, lt1 , lt2 ; l1 = strlen(line1);l2 = strlen(line2); l3 = strlen(line3); t=l1+l2+l3; total = malloc( t * sizeof(char) ) ; t1 = malloc( t * sizeof(char) ) ; t2 = malloc( t * sizeof(char) ) ; strcpy(total,line1);strcat(total,line2); strcat(total,line3); // characters to look for char c1 = '.'; char c2 = '-'; t1 = strchr(total,c1); lt1 = strlen(t1); t2 = strchr(total,c2); lt2 = strlen(t2); printf(" Character %c found at position %3d \n",c1,(t-lt1)); printf(" %c\n",total[t-lt1]); printf(" Character %c found at position %3d \n",c2,(t-lt2)); printf(" %c\n",total[t-lt2]); return(0); }