please only c code dont use c++ and c#. Function: write the compare_restaurants_descending function according to the given parameters. #include #include #include #define N 2000 #define D 250 // A simple restaurant structure typedef struct { char restaurant_name[15]; double rating; char city[31]; unsigned short opening_year; } RESTAURANT_t, *RESTAURANT; // Arraylist structure typedef struct ArrayList_s { void **list; int size; int capacity; int delta_capacity; } ArrayList_t, *ArrayList; * Function: compare_restaurants_descending * This function compares given restaurants with respect to first their ratings and then their names. It returns 1, if rest1 < rest2 -1, if rest1 > rest2 0, if rest1 = rest2 */ int compare_restaurants_descending(void *rest1, void *rest2) { // TODO: Fill this block. }
please only c code dont use c++ and c#. Function: write the compare_restaurants_descending function according to the given parameters.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define N 2000
#define D 250
// A simple restaurant structure
typedef struct
{
char restaurant_name[15];
double rating;
char city[31];
unsigned short opening_year;
} RESTAURANT_t, *RESTAURANT;
// Arraylist structure
typedef struct ArrayList_s
{
void **list;
int size;
int capacity;
int delta_capacity;
} ArrayList_t, *ArrayList;
* Function: compare_restaurants_descending
* This function compares given restaurants with respect to first their ratings and then their names. It returns
1, if rest1 < rest2
-1, if rest1 > rest2
0, if rest1 = rest2
*/
int compare_restaurants_descending(void *rest1, void *rest2)
{
// TODO: Fill this block.
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps