Created
June 23, 2014 17:40
-
-
Save pastagatsan/96d4b5facea4f576cdd8 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 <stdio.h> | |
typedef struct | |
{ | |
int plebeianness; | |
char * name; | |
} pleb; | |
void print_pleb(pleb p); | |
void bigger_pleb(pleb a, pleb b); | |
int main() | |
{ | |
pleb vivid = {12, "vivid"}; | |
pleb hollinski = {9001, "Hollinski"}; | |
print_pleb(vivid); | |
print_pleb(hollinski); | |
bigger_pleb(vivid, hollinski); | |
return 0; | |
} | |
void print_pleb(pleb p) | |
{ | |
printf("%s's plebeianness level is %d\n", p.name, p.plebeianness); | |
} | |
void bigger_pleb(pleb a, pleb b) | |
{ | |
if (a.plebeianness > b.plebeianness) | |
printf("%s is a bigger pleb than %s\n", a.name, b.name); | |
else if (a.plebeianness < b.plebeianness) | |
printf("%s is a bigger pleb than %s\n", b.name, a.name); | |
else | |
printf("They are both equally plebeian.\n"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment