鱼C论坛

 找回密码
 立即注册
查看: 1719|回复: 2

[已解决]报错问题中

[复制链接]
发表于 2022-6-21 21:38:11 | 显示全部楼层 |阅读模式

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

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

x
  1. #include <stdio.h>
  2. #include "stdlib.h"
  3. #include <windows.h>

  4. int mian()
  5. {
  6.         char userinput
  7.         printf("如果您注册完了邮箱,请输入go\n");
  8.         printf("如果您注册完了微软账户,请输入exit\n");
  9.         scanf("%s",&userinput);
  10.        
  11.         if ( userinput == 'go' ){
  12.                 system("start https://signup.live.com/");
  13.         }
  14.        
  15.         if ( userinput == 'exit' ){
  16.                 printf("您已完成所有操作,如果想要联系我的话,qq:3044067398");
  17.         }
  18. }
复制代码

tnnd,我之前这样写就可以,现在就不行,我恨你,C语言,求大佬解惑
最佳答案
2022-6-22 06:16:58
  1. #include <stdio.h>
  2. #include "stdlib.h"
  3. #include <windows.h>

  4. int main()//////////main
  5. {
  6.         char userinput[5]={0};
  7.         printf("如果您注册完了邮箱,请输入go\n");
  8.         printf("如果您注册完了微软账户,请输入exit\n");
  9.         scanf("%s",&userinput);

  10.         if ( *(short*)(userinput) == *(short*)("go")){
  11.                 system("start [url]https://signup.live.com/[/url]");
  12.         }

  13.         if (*(int*)(userinput) == *(int*)("exit" )){
  14.                 printf("您已完成所有操作,如果想要联系我的话,qq:3044067398");
  15.         }
  16. }
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复

使用道具 举报

发表于 2022-6-22 06:16:58 | 显示全部楼层    本楼为最佳答案   
  1. #include <stdio.h>
  2. #include "stdlib.h"
  3. #include <windows.h>

  4. int main()//////////main
  5. {
  6.         char userinput[5]={0};
  7.         printf("如果您注册完了邮箱,请输入go\n");
  8.         printf("如果您注册完了微软账户,请输入exit\n");
  9.         scanf("%s",&userinput);

  10.         if ( *(short*)(userinput) == *(short*)("go")){
  11.                 system("start [url]https://signup.live.com/[/url]");
  12.         }

  13.         if (*(int*)(userinput) == *(int*)("exit" )){
  14.                 printf("您已完成所有操作,如果想要联系我的话,qq:3044067398");
  15.         }
  16. }
复制代码
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2022-6-22 08:49:12 | 显示全部楼层
小甲鱼最新课程 -> https://ilovefishc.com
回复 支持 反对

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-4-24 01:24

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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