鱼C论坛

 找回密码
 立即注册
查看: 1035|回复: 10

[已解决]这是什么问题

[复制链接]
发表于 2021-12-21 15:44:26 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
这是什么问题 求解答
最佳答案
2021-12-21 16:24:24
我用gcc试了一下你的代码,没有问题
  1. #include <stdio.h>

  2. struct date{
  3.         int month, day, year;
  4. };

  5. int main(int argc, char const *argv[]){
  6.         struct date today = {12, 21, 2021};
  7.         struct date thismonth = {.month = 12, .year = 2021};
  8.         printf("xxxxx %i %i %i\n", today.year, today.month, today.day);
  9.         printf("xxxx %i %i %i", thismonth.year, thismonth.month, thismonth.day);
  10.         return 0;
  11. }
复制代码
360截图20211221154304435.jpg
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2021-12-21 15:51:31 From FishC Mobile | 显示全部楼层
int main(int argc, const char *argv[])
你写错了,如果不熟悉,就不要放参数!
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2021-12-21 15:57:37 | 显示全部楼层
傻眼貓咪 发表于 2021-12-21 15:51
int main(int argc, const char *argv[])
你写错了,如果不熟悉,就不要放参数!

改了 不放参数还是不对啊
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2021-12-21 16:09:52 From FishC Mobile | 显示全部楼层
还是不能就表示 int main(int argc, char const *argv[]) 没有错,错可能是你的结构类型
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2021-12-21 16:12:01 From FishC Mobile | 显示全部楼层
.day = ?
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2021-12-21 16:24:24 From FishC Mobile | 显示全部楼层    本楼为最佳答案   
我用gcc试了一下你的代码,没有问题
  1. #include <stdio.h>

  2. struct date{
  3.         int month, day, year;
  4. };

  5. int main(int argc, char const *argv[]){
  6.         struct date today = {12, 21, 2021};
  7.         struct date thismonth = {.month = 12, .year = 2021};
  8.         printf("xxxxx %i %i %i\n", today.year, today.month, today.day);
  9.         printf("xxxx %i %i %i", thismonth.year, thismonth.month, thismonth.day);
  10.         return 0;
  11. }
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2021-12-21 21:03:52 | 显示全部楼层
傻眼貓咪 发表于 2021-12-21 16:24
我用gcc试了一下你的代码,没有问题

是dev c++的问题吗  我用dev c++编译不行
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2021-12-21 21:07:03 | 显示全部楼层
LeaflLit 发表于 2021-12-21 21:03
是dev c++的问题吗  我用dev c++编译不行

能支持 C99 吗?
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2021-12-21 21:24:46 | 显示全部楼层

刚下了dev c++ 6.3 程序可以了
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2021-12-21 21:25:26 | 显示全部楼层
LeaflLit 发表于 2021-12-21 21:24
刚下了dev c++ 6.3 程序可以了

感谢
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2021-12-21 21:28:58 | 显示全部楼层
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2025-4-25 02:21

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表