Answered step by step
Verified Expert Solution
Question
1 Approved Answer
File I/O: Strings 1. Create string str initialized to alphabet 2. Create a FILE pointer MyTxt 3. Open file message.txt for text write 4. Write
File I/O: Strings 1. Create string str initialized to alphabet 2. Create a FILE pointer MyTxt 3. Open file "message.txt" for text write 4. Write string to file 5. Close the file 6. Open file for text read 7. Read string from file 8. Rewind to start of file 9. Read 5 characters from file 10. Position to letter j' in file 11. Read 5 characters starting at 'j' in file en rite Illustration 4 L? 41) In Illustration 4-1 What statement would create a string called str initialized to lower case alphabet? A) char strl] "abcdefghijklmnopqrstuvwxyz"; C) char* str[] "abcdefghij klmnopqrstuvwxyz". = 42) In Illustration 4-2 What statement would create a file pointer MyTxt? A) MyTxt FILE FILE MyTxt; MyTxt* 43) In Illustration 4-3 What statement would open the file "message.txt" to write text with MyTxt? tfopen("message tx (e MyTxt = fopen( "message.txt", "w"); MyTxt fopen("W"message.txt" MyTxt D) fopen ("message.txt"); = 44)In Illustration 4-4 What statement would put str into "message.txt" file? A) fputs (MyTxt) B) fwrite(str, MyTxt); D) fputs(str, MyTxt)
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