voice34
瓜瓜今天有猫了吗
采纳率100%
2019-03-17 15:52

c语言 In function 'int main(int, const char**)':

已采纳

#include

struct date {
int month;
int day;
int year;
};

int main(int argc, char const *argv[])
{
struct date today = {03,17,2019};
struct date thismonth = {.month=3, .year=2019};

printf("Today's date is %i-%i-%i.\n",
        today.year,today.month,today.day);
printf("This month is %i-%i-%i.\n",
        thismonth.year,thismonth.month,thismonth.day);

return 0;

}

初学者QWQ打扰啦

图片说明

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • caozhy 从今以后生命中的每一秒都属于我爱的人 2年前

    struct date today = {03,17,2019};不是所有编译器都支持这么写
    你可以用标准写法
    date today;
    today.month = 3;
    today.day = 17;
    today.tear = 2019;

    下面的类似

    点赞 评论 复制链接分享

相关推荐