First, I found a number of errors in the code as written:
1) Instructions say isSentEnd() is supposed to be sent a single int as a parameter, not a char array and an int.
2)
int c, i;
if (c==EOF) return(false);
c is not initialized before the == operator is called on it. This is an error.
3)
int c, i;
if (c==EOF) return(false);
wrd[0]=c;
Not surprisingly, c is still not initialized by the time you get to the third line above. Again an error.
4) (c='?') || (c='!') || (c='.')
These are all assignments to c. I suspect you meant checking for c equality with each of the char values instead.
5) wrd[i]=('!' || '?' || '.')
Again I suspect you wanted to check for equality, but you used the assignment operator instead, and you can't do multiple equality checks like that, in any event, you need to do them one at a time.
There may be more, but I'll stop there.
Furthermore, I think you need to answer the question of where is the input text coming from? I suspect it is coming from a file, however.
Assuming the input text is coming from a file I would start with the following logic to solve the problem:
Within main() I would declare a char array with 201 elements to hold the sentence as it is read from a file and I'd set the first char of the array to null. I'd then set up filepointer to read from the input file. I'd read the file one char at a time. If the current char read in is whitespace and the last char in sentence is not a space then I would add a space char to the holding array. If the char read in from the file isn't whitespace I would cast it to an int and send it to isSentEnd(). Within isSentEnd() I'd compare the int sent with the int values associated with the punctuation marks. If the int sent is a terminating punctuation mark or if the index of the array is 199 then the holding char array is null terminated and the resulting string is sent to another file, printed to the screen or whatever else you are told to do with it. I would then clear the holding string by assigning the null char to the first element of the holding char array and assign zero to index to get ready for the next sentence read in from the file. I would keep reading from the file until the char read in equalled EOF.
Here's how that logic may be written in pseudocode:
#includes
bool isSentEnd(int sentInt)
if sentInt equals int value of any of the terminating punctuation char
return true
else
return false
int main()
char c = 'Z' //to hold char read from file
int i = 0; //to hold int value of char read in from file
int index = 0;
char sentence with 201 elements //sentence can hold up to 200 char
assign null char to element 0
FILE * p;
open input file to read with p
confirm file opened
while ((c = fgetc(p)) != EOF)
if c is whitespace
if sentence[index - 1] not equal space char
assign space char to sentence[index];
increment index;
else
assign c to sentence[index];
increment index;
cast c to an int and assign it to i;
if(isSentEnd(i) OR index equals 200)
assign null char to sentence[index]
do what needs to be done with sentence
assign null char to sentence[0]
assign zero to index
I suspect there are errors in that logic as well, so use it only as an example of how you might go about answering the problem. You may need to do bounds checks associated with index to handle leading whitespace in addition to whitespace within the sentence, etc.