启动kafka报错,应该怎么解决
展开全部
#include<stdio.h>
#define list_init_sise 6
#define listincrement 1
/*#define listsize 6 */
#define elemtype int
typedef struct
{ elemtype *elem;
int length;
int listsize;
} sqlist;
status initlist_sq ( sqlist &L )
{ L.elem =( elemtype* ) malloc ( list_init_size * sizeof ( elemtype ));
if ( !L.elem ) exit ( 1 );
int i=0, j=0;
char m;
printf (" \nDo you want to input your datas(yes-anykey|no-n): ");
scanf (" \t %c", &m );
L.listsize=list_init_size;
while ((( m != "n" || m != "N" ))&&( i < L.listize ))
{ printf (" \nPlease input your datas: ");
scanf (" \t %d ", &L.elem[i] );
j++:
}
if ( m != "n" || m!= "N" )
L.length = 0;
else
L.length = j;
return 0;
} //initlist_sq
status listinsert_sq ( sqlist &L , int i , elemtype e )
{ if ( i < 1 || i > L ) return 2;
if ( L.length >= L.length + 1 )
{ newbase = ( elemtype * ) realloc ( L.elme ,
( L.listisize + listincrement ) * sizeof ( elemtype ));
if ( ! newbase ) exit ( 1 );
L.elem = newbase;
L.listsize += listincrement;
}
q = &( L.elem[i-1] );
for ( p = &( L.elem[L.length - 1] ); p >= q; --p )
*( p+1 )=* p;
++L.length;
return 0;
}
status listdelete_sq ( sqlist &L , int i , elemtype &e )
{ if (( i < 1 )||( i > L.length )) return 2;
p = &( L.elem[i-1] );
e = *p;
q = L.elem + L.length - 1;
for ( ++p; p <= q; ++p )
=+ p;
-- L.length;
return e;
}
int locateelem_sq ( sqlist L, elemtype e,
status ( *compare )( elmetype , elemtype ))
{ i = 1;
p = L.elem;
while ( i <= L.length && !( *compare )( *p++ , e )) ++1;
if ( i <= L.length ) return i;
else return 0;
}
void main()
{ sqlist L;
int n;
int ins, del, loc;
int insl, dell, locl;
char ch1, ch2, ch3;
initlist_sq ( L );
do
{ printf ( "\nChoice: 0.Exit 1.Insret 2.Delete 3.Find ");
scanf ( "\nInput: %d ", &n );
switch ( n )
{ case 1 : { do
{ printf ( "\nInput the data you want to insert:");
scanf ( "\nInput: %d ", &ins );
printf ( "\mInput the address where to insert:");
scanf ( "\nInput: %d ", &insl);
listinsert_sq ( L, insl, ins );
printf ( "\nInsert again(yes-angkey|no-n)?" );
scanf ( "\c", &ch1 );
} while ( ch1 == "N" || ch1 == "n" );
}
case 2 : { do
{ printf ( "\mInput the address where to delete:");
scanf ( "\nInput: %d ", &dell);
listdelete_sq ( L, dell, del );
printf ( "\nDelete again(yes-angkey|no-n)?" );
scanf ( "\c", &ch2 );
} while ( ch2 == "N" || ch2 == "n" );
}
case 3 : { do
{ printf ( "\mInput the datas you want to find:");
scanf ( "\nInput: %d ", &loc);
locateelem_sq ( L, loc );
printf ( "\nFind again(yes-angkey|no-n)?" );
scanf ( "\c", &ch2 );
} while ( ch2 == "N" || ch2 == "n" );
}
case 0 : break;
}
#define list_init_sise 6
#define listincrement 1
/*#define listsize 6 */
#define elemtype int
typedef struct
{ elemtype *elem;
int length;
int listsize;
} sqlist;
status initlist_sq ( sqlist &L )
{ L.elem =( elemtype* ) malloc ( list_init_size * sizeof ( elemtype ));
if ( !L.elem ) exit ( 1 );
int i=0, j=0;
char m;
printf (" \nDo you want to input your datas(yes-anykey|no-n): ");
scanf (" \t %c", &m );
L.listsize=list_init_size;
while ((( m != "n" || m != "N" ))&&( i < L.listize ))
{ printf (" \nPlease input your datas: ");
scanf (" \t %d ", &L.elem[i] );
j++:
}
if ( m != "n" || m!= "N" )
L.length = 0;
else
L.length = j;
return 0;
} //initlist_sq
status listinsert_sq ( sqlist &L , int i , elemtype e )
{ if ( i < 1 || i > L ) return 2;
if ( L.length >= L.length + 1 )
{ newbase = ( elemtype * ) realloc ( L.elme ,
( L.listisize + listincrement ) * sizeof ( elemtype ));
if ( ! newbase ) exit ( 1 );
L.elem = newbase;
L.listsize += listincrement;
}
q = &( L.elem[i-1] );
for ( p = &( L.elem[L.length - 1] ); p >= q; --p )
*( p+1 )=* p;
++L.length;
return 0;
}
status listdelete_sq ( sqlist &L , int i , elemtype &e )
{ if (( i < 1 )||( i > L.length )) return 2;
p = &( L.elem[i-1] );
e = *p;
q = L.elem + L.length - 1;
for ( ++p; p <= q; ++p )
=+ p;
-- L.length;
return e;
}
int locateelem_sq ( sqlist L, elemtype e,
status ( *compare )( elmetype , elemtype ))
{ i = 1;
p = L.elem;
while ( i <= L.length && !( *compare )( *p++ , e )) ++1;
if ( i <= L.length ) return i;
else return 0;
}
void main()
{ sqlist L;
int n;
int ins, del, loc;
int insl, dell, locl;
char ch1, ch2, ch3;
initlist_sq ( L );
do
{ printf ( "\nChoice: 0.Exit 1.Insret 2.Delete 3.Find ");
scanf ( "\nInput: %d ", &n );
switch ( n )
{ case 1 : { do
{ printf ( "\nInput the data you want to insert:");
scanf ( "\nInput: %d ", &ins );
printf ( "\mInput the address where to insert:");
scanf ( "\nInput: %d ", &insl);
listinsert_sq ( L, insl, ins );
printf ( "\nInsert again(yes-angkey|no-n)?" );
scanf ( "\c", &ch1 );
} while ( ch1 == "N" || ch1 == "n" );
}
case 2 : { do
{ printf ( "\mInput the address where to delete:");
scanf ( "\nInput: %d ", &dell);
listdelete_sq ( L, dell, del );
printf ( "\nDelete again(yes-angkey|no-n)?" );
scanf ( "\c", &ch2 );
} while ( ch2 == "N" || ch2 == "n" );
}
case 3 : { do
{ printf ( "\mInput the datas you want to find:");
scanf ( "\nInput: %d ", &loc);
locateelem_sq ( L, loc );
printf ( "\nFind again(yes-angkey|no-n)?" );
scanf ( "\c", &ch2 );
} while ( ch2 == "N" || ch2 == "n" );
}
case 0 : break;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询