Question: IN C++ Write a program in c++ that will read from a file the following sentence: The quick brown fox jumps over the lazy dog
IN C++
Write a program in c++ that will read from a file the following sentence:
The quick brown fox jumps over the lazy dog
Each word must be read into one location in an array beginning with the first element. You must declare an array as follows:
char *words [9] ; // this is an array of c- strings.
HINT
words[0] will contain "the"
words[1] will contain "quick"
write a function int length (const char *a) to determine the length of each string by incrementing the pointer until we find the null character '\0'. Once you have determined hte length of each string, fill the following arrays as follow:
char *t3[[ ] = {"the", ...
char *t4 [ ] = {"quick", "brown", ...
where a each number is the length of the string ( not counting the null character). continue adding each string to its respective array ( t3, t4, ...) until you have reached the end of the array called words.Do not use 2dimensional arrays.
Finally, print all words of each arrayvertically seperated by a blank line
The
T
h
e
Quick
q
u
i
c
k
ect....
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
