C Programming Please Give Comments Onto Code Added Codes Readlinec Include Include Include Q37176853

(70 points) Modify project 9 by adding and modifying the following functions: 1) Add a delete function in request. c that del(C Programming only) Pleasegive comments onto where each code should be added.

The codes:

Readline.c

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include “readline.h”
int read_line(char str[], int n)
{
int ch, i = 0;
while (isspace(ch = getchar()))
;
str[i++] = ch;
while ((ch = getchar()) != ‘n’) {
if (i < n)
str[i++] = ch;
}
str[i] = ”;
return i;
}

Readline.h

#ifndef READLINE_H
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int read_line(char str[], int n);
#endif

Request.c

#include <stdio.h>

#include <stdlib.h>

#include “request.h”

struct request *append_to_list(struct request *list){

   int room_number;

printf(“Enter room number: “);

scanf(“%d”, &room_number);

  

   while (getchar() != ‘n’);

   struct request *ptr = list;

   if(list

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.