604 Subj : help with strings and functions To : borland.public.cpp.borlandcpp From : "kristine" Date : Fri Aug 15 2003 09:35 pm hi all- i am having a problem with reading a string from a first function into a second function in order to manipulate it. this is an assignment so i have to use two different functions to complete the task. what i've done so far gets the output to look correct but the second function I have written does not use the original sentence i will be typing in. the point of the assignment is to use a loop in the second function to read the sentence originally read in thru the first function. the input will be "This is my sentence." i need to chop off the word this and put it into array word[], and put the remaining prtion of the sentence into array sentence2[]. can anyone please help. the following is what i have so far: #include #include void readsentence (char []); void cutword (char[], char[]); void main () { char sentence[21], word[5], sentence2[16]; readsentence (sentence); cutword (word, sentence2); } void readsentence (char sentence []) { printf("Please type in a sentence.\n"); gets(sentence); printf("\nHere is the sentence: "); puts(sentence); } void cutword (char word[], char sentence2[]) { char originalsent[21]="Here is my sentence."; strncpy(word, originalsent+0,5); word[5]='\0'; puts(word); strncpy(sentence2, originalsent+5,21); sentence2[16]='\0'; puts(sentence2); } . 0