Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- typedef struct { char *name; int num; } eat_t;
- int main(void) {
- eat_t eat[][2] = {
- {{"もも" , 1}, {"みかん" , 2}},
- {{"きゅうり" , 3}, { "ナス" , 4}}
- };
- int i, j;
- for (i = 0; i < sizeof(eat) / sizeof(eat[0]); i++) {
- for (j = 0; j < 2; j++) {
- printf("%s: %d\n", eat[i][j].name, eat[i][j].num);
- }
- puts("");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement