Question
Write a Function based C++ program that reads text (character data) from the file. Words in the file are separated by white spaces. The program
Write a Function based C++ program that reads text (character data) from the file. Words in the file are separated by white spaces.
The program shall find the length of each word and save the lengths in an array.
You are strictly not allowed to use anything other than pointers and dynamic memory. One function should perform one functionality only.
(1) Open File
(2) Read only character data not integers
(3) Find length and save in an array
(4) Please Follow the Sample Output
Example
Text.txt: 47 A QUICK 12345 JUMPS OVER 50012 21212 LAZY 11111
Original text: A QUICK JUMPS OVER LAZY
Array of Lengths: 1 5 5 4 4
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started