3.Which of the following will read a string from a file with FILE* fpto char myString[81] properly (safely): fscanf(fp, "%s", myString ); fgets(myString, fp); fgets(fp, 81, myString); correct : fgets(myString, 81,fp) fscanf(fp,"%80s", myString); 4. If you issue the statement fpIn = fopen("myfile.dat", "a");and dat does not exist, the computer will: return NULLto fpIn as the file does not exist create the file in write mode, and position the file pointer at the beginning of the file create the file in write mode, close the file and return a warning open a file that most closely resembles the name 'myfile.dat'
3.Which of the following will read a string from a file with FILE* fpto char myString[81] properly (safely): fscanf(fp, "%s", myString ); fgets(myString, fp); fgets(fp, 81, myString); correct : fgets(myString, 81,fp) fscanf(fp,"%80s", myString); 4. If you issue the statement fpIn = fopen("myfile.dat", "a");and dat does not exist, the computer will: return NULLto fpIn as the file does not exist create the file in write mode, and position the file pointer at the beginning of the file create the file in write mode, close the file and return a warning open a file that most closely resembles the name 'myfile.dat'
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter8: I/o Streams And Data Files
Section8.4: File Streams As Function Arguments
Problem 3E
Related questions
Question
3.Which of the following will read a string from a file with FILE* fpto char myString[81] properly (safely):
-
- fscanf(fp, "%s", myString );
- fgets(myString, fp);
- fgets(fp, 81, myString); correct : fgets(myString, 81,fp)
- fscanf(fp,"%80s", myString);
4.
- If you issue the statement fpIn = fopen("myfile.dat", "a");and dat does not exist, the computer will:
- return NULLto fpIn as the file does not exist
- create the file in write mode, and position the file pointer at the beginning of the file
- create the file in write mode, close the file and return a warning
- open a file that most closely resembles the name 'myfile.dat'
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT