问个小问题。。关于指针数组的
大家好,我编下面的代码时会报“非法索引,不允许间接寻址”的错,请问有什么好办法能解决这个问题吗?
AVCodecContext** aCodecCtx = new AVCodecContext*[tracksIndex];
AVCodec** aCodec = new AVCodec*[tracksIndex];
for(i = 0;i < tracksIndex;i++)
{
aCodecCtx[i] = ic->streams[audioindex]->codec;
aCodec[i] = avcodec_find_decoder( aCodecCtx->codec_id );
if( avcodec_open(aCodecCtx[i],aCodec[i] ) < 0 )
{
strMsg.Format( _T("can't open the #%d audio decoder"),i );
AfxMessageBox( strMsg );
return -1;
}
}