dev C++出现错误Pernission denied ld returned 1 exit status

来源:百度知道 编辑:UC知道 时间:2024/06/03 18:15:26
程序代码如下,我把其他的都注释掉了
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "conio.h"
typedef struct node/*定义空闲内存空间*/
{
int size;
int address;
struct node *next;
}freeable;
typedef struct nod/*定义已使用内存空间*/
{
int size;
int address;
char name[20];
struct nod *next;
}used;
main()
{

int remain=128;
char c;
struct node *p,*newnode;
struct nod *q,;
q=(used *)malloc(sizeof(used));
q->next=NULL;
q->address=-1;
newnode=(freeable *)malloc(sizeof(freeable));
newnode->address=0;
newnode->size=128;

要写一个邻接表?
抄抄数据结构上的吧
代码不全,不知道有没有逻辑错误,倒是有一个语法错误:
struct nod *q,; //这个地方 分号 前头多了一个 逗号

还有一个楼上说的不对的地方,就是main的定义:
根据c99规则main()当不定义类型时,默认为int型,并且若定义,main()也只能为int型。虽然在DEV中,void main()是可以通过编译的,但不符合标准。比如你找北大的OJ去测个程序,应该用void main()是会出现编译错误的。

楼主的程序基本正确,除了两个编译小问题:
1、main函数漏贴了一个结束花括号,且定义为void main()。
2、去掉指令struct nod *q,; 中的逗号。

问题可能出在生成执行文件时访问的权限不够,比如生成执行文件所在的文件目录没有写权限。

机子有病毒?