Open SangYeop-Lee opened 7 years ago
에러 전체랑 코드를 보여주세요
앗 저 에러는 해결된 것 같습니다..
return 0; 를 하고 루프를 끝냈을 때 저 0 값을 불러오는 함수는 없나요?
빨간 글씨로 에러가 뜨는 것이 아니라 이런식으로 컴파일 도중에 에러가 뜨는데 해결 방법을 모르겠습니다ㅜㅜㅜㅜ..
코드 전체를 보여주세요
/**
/**
Returns true if value is in array of n values, else false. */ bool search(int value, int values[], int n) { // TODO: implement a searching algorithm ( binary search )
int frst = 0; int thrd = n-1; int scnd = (frst+thrd)/2;
do {
if ( value < values[scnd] )
{
thrd = scnd-1;
scnd = (frst+thrd)/2;
}
else if ( value > values[scnd] )
{
frst = scnd+1;
scnd = (frst+thrd)/2;
}
else
{
break;
}
} while ( frst != scnd || frst != thrd );
if ( value == values[scnd] ) { return true; }
return false;
}
/**
Sorts array of n values. */ void sort(int values[], int n) { // TODO: implement a sorting algorithm ( bubble sort ) int i, k; k = 0; do { for (i = 0; i < n-1 ; i++) { if(values[i] <= values[i+1]) { i++; k = k+1; }
else
{
int tmp;
tmp = values[i];
values[i] = values[i+1];
values[i+1] = tmp;
i++;
k = 0;
}
}
} while ( k < 2*n );
return; }
helpers.h 는 작성하셨나요?
앗..아니요... 어떻게 작성해야하나요...?
Whodunit 중 small.bmp 에서 3X3 픽셀을 pad를 넣어 3X4로 만들어 주어야 하나요?
라는 코드를 사용했을 때 뜨는 에러인데, 어느 부분이 잘못되었는지 모르겠습니다ㅠㅠ..