Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

File I/O: binary 1. Create a FILE pointer myfunds 2. Open a file for binary write 3. Binary write block of memory containing money array

File I/O: binary

1. Create a FILE pointer myfunds

2. Open a file for binary write

3. Binary write block of memory containing money array

4. Close the file

5. Open file for binary read

6. Binary read into block of memory containing savings

Illustration 3:

32)In Illustration 3-1When declaring a file pointer, FILE is used. What type of object is FILE?

A) a predefined system operator

B) a predefined system pointer

C) a predefined system function

D) a predefined system structure

33)In Illustration 3-1 How would a file pointer named myfunds be declared?

A) FILE myfunds;

B) FILE * myfunds;

C) FILE [myfunds];

D) myfunds FILE *;

34)In Illustration 3-2What statement would correctly open the file funds.val and initialize the file pointer to write

binary information?

A) fopen("myfunds", "wb");

B) myfunds = fopen("funds.val");

C) myfunds = fopen("funds.val", "w");

D) myfunds = fopen("funds.val", "wb");

35)In Illustration 3-2What happens if fopen returns NULL?

A) void, so no return argument used

B) file is successfully opened

C) file could not be opened

D) continue to use NULL pointer

36)In Illustration 3-3 What statement would write int money[30]; to funds.val file?

A) fwrite(money, sizeof(int), myfunds);

B) fwrite(money, 30, myfunds);

C) fwrite(money, sizeof(int), 30, myfunds);

D) fwrite(myfunds, sizeof(int), 30, money)

37)In Illustration 3-4 What statement would close funds.val?

A) fclose (myfunds);*

B) fclose(money);

C) FileClose(money, myfunds);

D) FILE(close, myfunds ,money);

38)In Illustration 3-5 What statement would open funds.val file to read binary?

A) myfunds = fopen("funds.val", "rb");

B) FILE fopen("funds.val", "r", myfunds);

C) myfunds = fopen("funds.val", "b");

D) fopen(myfunds, "b", "funds.val");

39)In Illustration 3-6 What statement would read int savings[30]; from funds.val file?

A) nread = fread(fp, savings);

B) nread = fread(fp, sizeof(int), 30, savings);

C) nread = fread(savings, fp);

D) nread = fread(savings, sizeof(int), 30, fp);

40)In Illustration 3-6 What value does nread get after reading int savings[30];from funds.val file? nread = fread(savings, sizeof(int), 30, fp);

A) 120 if successful

B) 0 if successful

C) 30 if successful

D) 1 if successful

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

0201844524, 978-0201844528

More Books

Students also viewed these Databases questions

Question

3. What strategies might you use?

Answered: 1 week ago

Question

3. Write a policy statement to address these issues.

Answered: 1 week ago