Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created Mar 25, 2019
Embed
What would you like to do?
#include <stdlib.h>
#include "room.h"
struct Room {
float width;
float length;
};
Room* new_room(float width, float length){
Room* room = malloc(sizeof(Room));
room->width = width;
room->length = length;
return room;
}
float area(struct Room *room) {
return room->length * room->width;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment