Write a program (in a single .c file) with a queue of strings implemented using array. You should write ite a queue type. The program reads a set of strings stored in a file (filename given on command line as argument) and inserts each string in the queue. Then it removes each string and writes it to another file (also given as second argument on command line).
filename: rollno_branch_batch_queuefile.c
Note: for this particular assignment, you must use open(), read(), write() calls and use of fopen(), fread(), etc functions is not allowed.
Hints:
* This problem involves some thinking about combinging the various different concepts about files, queues, data type implementation, array handling, etc.
* You have to implement a queue type which means, write the code for enqueue(), dequeue(), etc functions of the queue. This has to be done using an array and indexes as required, AND NOT using structures, pointers, and malloc as done in the class. You can refer to the way we've written stack.
* The program essentially copies a file into another. However before data goes from one file to another, it is temporarily stored in the queue of strings.
* The known functinos like read(), write() etc do not recognize strings. String is a char array terminated by NUL character. The read(), write() functions simply read some bytes from the file. So you will be required to process the data read from the file also.
priya_pawar
0
Newbie Poster
Recommended Answers
Jump to PostI am sorry but we are not going to spoonfeed you for your assignments. Try out something and then ask speciific questions.
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.