[Solved] One Show Code C U Use Reading Txt File Contain String Inside Q37180954
Does any one show me the code in C++ below that, u can use anyreading txt file which contain the string inside
17:48 l cricket Back P2.B MYString v1 Detail Submission Grade read one string from the istream argument (could be from cin or an ifstream variable). This should work just ike the >>operator. When reading in, you can assume that you will not read in a string onger than 99 characters. This function will return true if it was able to read (remember>> operator will return true if it is able to read from a file) read( istream& istrm): bool For simplicity sake, you could create a local char array variable 100 that you first read into and then you could copy from this char array into your ynamic memory write the string out to the writel ostream& ostream argument, but do not ostrm) void add any end of line (could be cout or an ofstream variable) compares the object string (objStr) to the argument string (argStr) by subtracting each element of argStr from objStr until a difference is found or until all elements have been compareTo const MYString& argStr): int compared objStr < argStr returns a negative number objStr > argStr returns a positive number objStr argStr returns zerd return a pointer to a constant cstring version of the MYString obiect. This can be nice for simple outputs: cout << objStr.c str)<< endl; // displays var contents to display this does the assignment ):const char * setEqualTo(const operation objStr.setEqualTo argStr) would change objStr so that it would contain the same information as argStr MYString& argStr): void Show transcribed image text 17:48 l cricket Back P2.B MYString v1 Detail Submission Grade read one string from the istream argument (could be from cin or an ifstream variable). This should work just ike the >>operator. When reading in, you can assume that you will not read in a string onger than 99 characters. This function will return true if it was able to read (remember>> operator will return true if it is able to read from a file) read( istream& istrm): bool For simplicity sake, you could create a local char array variable 100 that you first read into and then you could copy from this char array into your ynamic memory write the string out to the writel ostream& ostream argument, but do not ostrm) void add any end of line (could be cout or an ofstream variable)
compares the object string (objStr) to the argument string (argStr) by subtracting each element of argStr from objStr until a difference is found or until all elements have been compareTo const MYString& argStr): int compared objStr argStr returns a positive number objStr argStr returns zerd return a pointer to a constant cstring version of the MYString obiect. This can be nice for simple outputs: cout
Expert Answer
Answer to Does any one show me the code in C++ below that, u can use any reading txt file which contain the string inside… . . .
OR

