
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
I need help implementing this Add file i/o to my program
Please show me where I should implement this in my code as well so I have a better understanding
Any help and or assistance would be appreciated I've already tried a bunch of stuff but I am very confused I have been working on this for at least 10 hours over the last two days
link to my code that I currently have you may fork it so that you can use it as a foundation
https://onlinegdb.com/Md9bN7s-Z

Transcribed Image Text:Add file i/o to your program
Implement a function writeEmpToFile that takes two arguments: a struct Employee pointer and a FILE *.
It should write each field in order as an appropriate type. Note that you will probably want to write a length of the name before you write the characters
of the name. By doing this, when you write the load function below, you can read the length of the string and use it to malloc a buffer of the proper size
to hold the name.
Because of the embedded name pointer, you CAN NOT write the Employee struct as a single struct. You will need to write it out field by field. You will
want to write this as a binary file, not as a text file.
Implement a SAVE command in your main loop that will save all the employees out to a file. The SAVE command should ask for a file name, similar to the
way your FIND command asked for a name.
Implement a function readEmpFromFile that takes a FILE * as the only argument and returns a pointer to a struct employee. This function should read the
information from the file (reversing what writeEmpToFile does), create a new employee and fill in the data. If the FILE has no more info (is at end of file),
this function should return NULL. This function must also ensure any employee actually created (not the NULL) is added to the array (as is done in
createEmployee).
Change main to load employees from a file if a command line argument is given to the program (using your readEmpFromFile function you just wrote).
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps

Knowledge Booster
Similar questions
- CLASS OF 2019 Welcome MySAIL Oakland Un X Th Course: CSI-1420-43702.201940 X https://moodle.oakland.edu/plug X DG Difference between two given tin X F C moodle.oakland.edu/pluginfile.php/5600130/mod assign/intro/Homework02.txt?time-1570288894866 Program 3 Program: mitime.c Executable: mitime.o Write a program that reads two times in military format (e.g. 0900, 1730), and prints the number of hours and minutes between the two times. Assume that the hours and minutes of the second time are greater than the first time. See an example below. User input is underlined (your program does not have to underline the user input). Please enter the first time: 0900 Please enter the second time: 1730 8 hours 30 minutesarrow_forwardpythonarrow_forwardCreate a new javascript file called cart.js and make a product object for each of your products and store it in a products array when the script loads. Create an empty array to store the items added to the cart. Program the "add to cart button" to take the product id, finds the product object in the products array and adds it to the items added to cart array. Program the "remove from cart button" to take the product id and remove the project object from the items purchased array. Existing code: <!DOCTYPE html><html> <head> <div id="product1" class="card"><img src="img/clorox.jpg"><h1>Clorox</h1><p class="price">$20.00</p><p>Household Cleaner</p><p><button id="product1Btn1">Add to Cart</button></p><p><button id="product1Btn2">Remove from Cart</button></p></div> <div id="product2" class="card"><img src="img/oxiclean.jpg"><h1>Oxiclean</h1><p…arrow_forward
- JavaScript Dom Manipulation Hi can anyone please help me fix my main.js file. We're not allowed to change anything in index.html. We have to make a button so that every time you click on it the count on the web page increases by one. My code doesn't work and I don't know why. Every time I click the button, nothing happens. We just started learning about DOM and the only method we've learned so far is document.querySelector() Please help me understand dom events better. thank you so much! main.js var numTimesClicked = 0; function handleClick(event) { numTimesClicked++; console.log('button clicked'); console.log('event:', event); console.log('event.target', event.target); } var $click = document.querySelector('.click-count'); $click.addEventListener('click', handleClick); function handleMouseover(event) { console.log('button hovered'); console.log('event:', event); console.log('event.target', event.target); } index.html <!DOCTYPE html> <html…arrow_forwardomplete this javascript file according to the individual instructionsgiven in the comments. *** DO NOT CHANGE any of the code that you are not instructed to. */ ////////////////////////// NOTE: Use the API endpoints available at// https://jsonplaceholder.typicode.com/// to get the data required in these exercises.// HINT: Read the documented Resources and Routes.// Also the guide:// https://jsonplaceholder.typicode.com/guide//////////////////////// Create a function named "getUser".// This function needs to accept a "userID"// parameter.// Use Fetch with Async/Await to request// the data for the requested user.// The function should return JSON data.arrow_forwardadd tags for these feature files with --tags option: When you select scenarios by one tag When you select scenarios that have one or another tag When you select scenarios that have 2 tags When you disable scenarios that have a specific tag Given Scenarios: Feature: Login functionalityBackground:Given a web browser is at the BrainBucket login pageScenario: user can't login without entering emailGiven User is not logged inWhen Password is enteredAnd User click Login buttonThen 'Warning: No match for E-Mail Address and/or Password' will be shownScenario: user can recover his passwordGiven User is not logged inWhen User clicks 'Forgotten Password' buttonAnd enters his emailThen Message 'An email with a confirmation link has been sent your email address.' will be dispalyedarrow_forward
- I need help with a school project! My task is to extract a pdf file using python and output it in my sublime text IDE. What I need is to extract a pdf file and get all page numbers. In my example code I’m about to extract the first page number but need all pages numbers to be extracted! What can I do to fix this?arrow_forwardThe class I'm taking is assembly programming. I have attached the instructions. i have also attached my work. Can you please tell me how to fix it so I can successfully run and compile program in visual studio . i keep getting syntax errors on line 11 and 12. Thank you so much for your help!arrow_forwardQuestion pa This module will guide you through solving 92-36 by removal. Remove an(d)/(o)r add back values until you've removed 36 . You can only work with ones or tens. Use the table to track where you land and how much you've removed in total. 92-36 Full explain this question very fast solution sent me step by step Don't copy before solutionarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY