[求助]如何返回数组?
返回一个用条件编译的数组,输出不正确,我该怎么改?
#include<stdio.h>
#define ABC_C33
unsigned char *condition(void);
void main()
{
unsigned char *mat;
int n;
char buf[16];
mat=condition();
for(n=0;n<16;n++) {
buf2[n]=* mat++;
printf("0x%02x,",buf[n]);
}
}
unsigned char *condition(void)
{
#ifdef ABC_C33
unsigned char ABC_33[16] = {
0x00,0x00,0x18,0x3c,0x3c,0x3c,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00
};
return &ABC_33[16];
#endif
}
[此贴子已经被作者于2005-12-2 10:43:47编辑过]