. 2. Write a CH program that reads characters from the file mess.txt and sorts them into letters, digits, and symbols, t
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
. 2. Write a CH program that reads characters from the file mess.txt and sorts them into letters, digits, and symbols, t
. 2. Write a CH program that reads characters from the file mess.txt and sorts them into letters, digits, and symbols, then prints them neatly into a new file sorted.txt. Assume the number of characters in the file is unknown. Hints: use isdigit(c) to check if c is a digit use isalpha(c) to check if c is an alphabet • everything else is a symbol use the following lines to reset your ifstream pointer to the beginning of the file fin.clear(); finaseekg(0, ios::beg); . . Sample Output: sorted.txt Letters digits symbols f 2 95 j 8 ? f 7 H 4 & P 8 D Q N ONOCO *REP IQ OZ
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!