|
Region::dim 이란 변수를 가지고 float name[100]이런 형식으로 쓸수 없습니다.
dim이 define으로 정의된 상수이여야 한다는 겁니다. 100 이란 수치처럼 변하지 않는 값을 가져야 하는거죠
이처럼 변수로 할당하실려면 new [] 키워드를 사용하여 동적으로 할당하고 delete [] 를 사용해서
명시적으로 할당을 풀어주셔야 되겠죠..
Region class 정의가 없어서... 단순히 에러의 내용만 적어보았습니다.
constant expresson required -> "상수 표현이 요구됩(필요합)니다." 정도일까요..ㅋㅋ
그럼 수고하세요
최병기 님이 쓰신 글 :
: Region *Region::intersect_right(float split_coord, int current_dim)
: {
: float l, r;
:
: r=_right[current_dim];
: l=_left[current_dim];
:
: if (split_coord<=l)
: {
: // split point lies to the left
: return new Region(_left, _right);
: }
: else
: {
: if (split_coord<=r)
: {
: // split point in interval
: // adjust left
: int i;
: float new_left[Region::dim]; <<<< 여기서 constant expresson required 에서 발생
:
: for (i=0; i<Region::dim; i++)
: {
: new_left[i]=_left[i];
: }
: new_left[current_dim]=split_coord;
: return new Region(new_left, _right);
: }
: else
: {
: // interval lies to the left of split point
:
: return NULL;
: }
: }
: }
:
: 웹에서 소스 긁어 온건데 자꾸 저 부분에서만 에러가 발생 하네요
:
: 고수님들 도와 주세요
|