컴파일러 문제인가요? 왜 안되죠??
란새
질문 제목 : 질문 내용 : #include stdio.h
#include iostream
using namespace std;
#define max_len 30;
typedef int keytype;
typedef int index;
void seqsearch(int n, const keytype s[], keytype x, index& location);
void main()
{
int n;
index i;
index location;
keytype x;
keytype s[max_len+1]; //여기서 자꾸 에러 나요 ㅠㅠ
coutenter n (max of n is 30)\n;
cinn;
i=1;
while( i = n)
{
coutenters[i]endl;
cins[i];
i++;
}
coutenter a key x \n;
cinx;
seqsearch(n,s,x,location);
if(location != 0 )
coutyeslocationendl;
else
coutnoendl;
}
void seqsearch(int n, const keytype s[], keytype x, index& location)
{
location = 1;
while(location = n && s[location] != x)
location++;
if(location n)
location =0;}
-
예린
Wow 감사합니다 ㅋ
-
초코향
#define의 맨 끝에는 의도한 것이 아니라면 세미콜론 ; 을 적지 마세요.