Created
March 25, 2019 09:18
-
-
Save jasongorman/fa985d0a673eb129051f650e0ce43fe9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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