gpt4 book ai didi

c - 我是 C 的新手,这个段错误让我很生气

转载 作者:行者123 更新时间:2023-12-02 22:07:32 25 4
gpt4 key购买 nike

<分区>

我是 c 的新手,我正在努力上网,吸收资源来帮助学习。

我从一个简单的命令提示符类型交易开始,即使这样也给我带来了困难!我正在尽力学习指针,但这个想法对我来说很难理解,所以这里是给我带来麻烦的代码。我希望这段麻烦代码的答案能帮助我了解指针的语法。

#include <stdio.h>
#include <stdlib.h>
#include "login.h"
#include "help.h"
#include <malloc.h>

main()
{
if(login()) /* Login runs fine. After the imported */
{ /*login code runs, it takes me to the main screen */
int prac; /* (printf("Type help for a list of commands")) i input*/
char inpt[255]; /* help, the imported help screen runs,then the core
int *ptr; /*dumps. oh and i know the malloc() syntax is wront*/
malloc(255) == ptr; /*that's just the last thing i tried before i posted*/

*ptr == printf("Continuing Program...\n\n");
printf("---Type Help For a List of Commands----\n");
gets(inpt);
if (strcmp(inpt, help) == 1)
{
help();
goto *ptr;
}
}
return 0;
}

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com