Last active
May 27, 2016 04:03
-
-
Save tmiller/30529ef53a1f15258f15ca4ffdad109a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Crop* createCrop(/*... crop fields ...*/) { | |
// Create and return address of crop | |
} | |
enum names { | |
Garlic; | |
GreenBeen; | |
Kale; | |
Pasnip; | |
} | |
int main() { | |
struct Crop *crops[4]; | |
crops[Garlic] = createCrop(/*... crop fields ...*/) | |
crops[GreenBean] = createCrop(/*... crop fields ...*/) | |
crops[Kale] = createCrop(/*... crop fields ...*/) | |
crops[Parsnip] = createCrop(/*... crop fields ...*/) | |
// maybe access them like this? | |
for(int i = 0; i < len(crops); i++ { | |
*crops[n].Id = 4 | |
} | |
} |
This file contains hidden or 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
Crop* createCrop(/*... crop fields ...*/) { | |
// Create and return address of crop | |
} | |
int main() { | |
int Garlic = 0; | |
int GreenBeen = 1; | |
int Kale = 2; | |
int Pasnip = 3; | |
struct Crop *crops[4]; | |
crops[Garlic] = createCrop(/*... crop fields ...*/) | |
crops[GreenBean] = createCrop(/*... crop fields ...*/) | |
crops[Kale] = createCrop(/*... crop fields ...*/) | |
crops[Parsnip] = createCrop(/*... crop fields ...*/) | |
// maybe access them like this? | |
for(int i = 0; i < len(crops); i++ { | |
*crops[n].Id = 4 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment