我已经制作了MCVE例程,程序崩溃并在我添加到unpack_code函数后返回255(之前它正在工作):
int ch_bit;
unsigned int *ch_word;
ch_bit = *p_ch_bit;
Run Code Online (Sandbox Code Playgroud)
波士顿代码
#include <stdio.h>
#include <stdlib.h>
struct melp_param *par;
void unpack_code( unsigned int **p_ch_beg, int *p_ch_bit,
int *p_code, int numbits, int wsize,unsigned int erasemaks)
{
int ret_code;
int ch_bit;
unsigned int *ch_word;
ch_bit = *(p_ch_bit);
*p_code = 0;
}
void melp_chn_read(struct melp_param *par,
struct melp_param *prev_par)
{
}
int main(void)
{
int bit_buffer[42];
unpack_code(NULL, NULL, bit_buffer, 0, 0, 0);
return 0;
}
Run Code Online (Sandbox Code Playgroud)
经过一步一步的调试后:*p_ch_bit=Cannot access memory at address 0x0
和消息错误出现'分段错误.....'
请帮我