这段代码有错误么,为什么老是显示ld.exe||cannot open output file D:\Documents\XU.exe Permission d

跃2.0 2018-02-20 09:15:40
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct link
{
char name[20];
char password[20];
struct link *next;
} link,*linklist;

int main()
{

struct link *L;
L=(struct link*)malloc(sizeof(struct link));
strcpy(L->name,"oooo");
strcpy(L->password,"pppp");

printf("%s",L->name);
printf("%s",L->password);
L->next=NULL;
free(L);

}
...全文
1410 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
cattpon 2018-02-22
  • 打赏
  • 举报
回复
有的时候不知道怎么确认环境问题~
自信男孩 2018-02-22
  • 打赏
  • 举报
回复
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

struct link
{
    char name[20];
    char password[20];
    struct link *next;
} link,*linklist;


int main()
{

    struct link *L;
    L = (struct link*)malloc(sizeof(struct link));
    if (!L)
        exit(0);
    strcpy(L->name,"oooo");
    strcpy(L->password,"pppp");

    printf("%s\n",L->name);
    printf("%s\n",L->password);
    L->next=NULL;
    free(L);

    return 0;
}
程序没问题,建议检查配置环境
paschen 2018-02-20
  • 打赏
  • 举报
回复
代码没问题,出现原因可能是杀软或什么占用着,以致不能重新生成程序,一般重启或者去任务管理器结束了,或者新建另一个工程可正常
跃2.0 2018-02-20
  • 打赏
  • 举报
回复
现在去编译又很正常,这段代码没有什么实际意义,但是昨天老是出错

69,369

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧