我不明白这是什么意思:
error: return type is an incomplete type"
我只想返回结构。我已经分离了两个音频通道,我想使用一个使用唯一函数的结构来返回它们。
主.c:
#include "functions.h"
...
struct LandR sepChannels_8( unsigned char *, unsigned long, unsigned char *, unsigned char *);
...
int main()
{
...
sepChannels_8( ptrSamples_8, n, ptrSamples_8_L, ptrSamples_8_R );
...
}
函数.h:
...
struct LandR sepChannels_8( unsigned char *smp, unsigned long N, unsigned char *L, unsigned char *R )
{
struct LandR
{
unsigned char *L;
unsigned char *R;
};
struct LandR LRChannels;
int i;
if ( N % 2 == 0 )
{
L = malloc(N/2);
R = malloc(N/2);
}
else
if ( N % 2 == 1 )
{
L = malloc(N/2);
R = malloc(N/2);
}
for ( i = 0; i < N; i++ ) // separating
{
L[2 * i + 0] = smp[2 * i + 0];
R[2 * i + 0] = smp[2 * i + 1];
}
return LRChannels;
}
...