Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question - 5 ( Using Structs ) : Structs are useful in many situations when dealing with diverse data. For example, get the contents of

Question-5(Using Structs):
Structs are useful in many situations when dealing with diverse data. For example, get the contents of your
current directory by typing a=dir;
a.,a is a struct array. What is its size? What are the names of the fields in a?
b. Write a loop to go through all the elements of a, and if the element is not a directory, display the
following sentence 'File filename contains x bytes', where filename is the name of the file and x is
the number of bytes.
c. Write a function called displayDir.m, which will display the sizes of the files in the current
directory when run, as below. Your output may have different filenames.
image text in transcribed

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

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

More Books

Students also viewed these Databases questions

Question

What does that remind you of?

Answered: 1 week ago