Skip to content

Instantly share code, notes, and snippets.

@jasongorman
Created March 25, 2019 09:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasongorman/fa985d0a673eb129051f650e0ce43fe9 to your computer and use it in GitHub Desktop.
Save jasongorman/fa985d0a673eb129051f650e0ce43fe9 to your computer and use it in GitHub Desktop.
#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