Ç编译错误:ID返回1退出状态 [英] C compile error: Id returned 1 exit status

查看:957
本文介绍了Ç编译错误:ID返回1退出状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某些原因,当我尝试编译程序,编译器说,拒绝授权和Id返回1退出状态。谁能告诉我这是什么意思?谢谢

For some reason, when I try compiling a program, the compiler says permission denied and Id returned 1 exit status. Could anyone tell me what that means? Thank you

#include <stdio.h>                                               /* Library inclusions */
#include "genlib.h" 
#include "simpio.h"

int binSearch(int val, int numbers[], int size1);                /* prototypes */
void sortArray (int numbers[], int size1);                       
int indexMax (int numbers[], int low, int high);
void swap (int numbers[], int loc, int loc1);
void getArray (int numbers[], int size1);
void displayArray (int numbers[], int size1);

main()
{
  int value, size1;

  printf("Enter the number of elements: ");
  size1=GetInteger(); 
  int numbers[size1];
  getArray(numbers, size1); 
  sortArray(numbers, size1); 
  displayArray(numbers, size1);
  printf("\nEnter value to find: ");
  value=GetInteger();
  binSearch(value, numbers, size1);
  getchar();
}

void sortArray (int numbers[], int size1)                        /*Function sortArray*/
{
 int i , maxInd;

 for (i= size1-1; i>=0;i--)
 {
     maxInd=indexMax(numbers, 0, i);
     swap (numbers, i, maxInd);
 }
}

void displayArray (int numbers[], int size1)                     /*Function displayArray*/
{
 int i;

 printf("This is the sorted set of numbers: \n");
 for (i=0; i< size1; i++)
 {
         printf ("%d\t", numbers[i]); 
     }
}

void getArray (int numbers[], int size1)                         /*Function getArray*/
{
 int i;

 for (i=0; i<size1; i++)
 {
     printf ("Enter the values of the %d elements: ", size1);
     numbers[i]=GetInteger();
 }
}

int indexMax (int numbers[], int low, int high)                  /*Function indexMax*/
{
int i, maxInd;

maxInd=high;
for (i=low;i<=high;i++)
{
    if (numbers[i]>numbers[maxInd]) 
    {
                   maxInd =i;
    }
    }
    return (maxInd);
}

void swap (int numbers[], int loc, int loc1)                     /*Function swap*/
{
 int temp;

 temp=numbers[loc];
 numbers[loc]=numbers[loc1];
 numbers[loc1]=temp;
}

int binSearch(int val, int numbers[], int size1)                 /*Function binSearch*/
{
 int low, high, mid;

 low=0;
 high=size1-1;
 while(low<=high)
 {
                 mid=(low+high)/2;
                 if(val<numbers[mid])
                 {
                                 high=mid-1;                
                 }            
                 else if(val>numbers[mid])
                 {
                                 low=mid+1; 
                 }   
                 else if(val==numbers[mid])
                 {
                                 printf("Your number is in location %d\n", mid+1);break;    
                 } 
                 else
                 {
                                 printf("Your value is not in the array.");        
                 }
   }
}

以上是二进制搜索算法code我试图编译。

The above is the binary search algorithm code I tried to compile.

推荐答案

我可以猜到,你的程序的旧实例仍在运行。 Windows不允许修改这是目前正在使用的文件和链接器不能写上运行一个顶部的新的.exe文件。试试停止/杀死你的程序。

I may guess, the old instance of your program is still running. Windows does not allow to change the files which are currently "in use" and your linker cannot write the new .exe on the top of the running one. Try stopping/killing your program.

这篇关于Ç编译错误:ID返回1退出状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆