这里写自定义目录标题
网上查找了很多方法,发现按照下面代码可以自接读出各字节内容
FILE* fp;
if ((fp = fopen("C:/Users/mi/Documents/amr.pcap", "r")) == NULL)
{
printf("Fail to open file!\n");
exit(0); //退出程序(结束程序)
}
unsigned char str[RTP_MAX_NUM + 1]={0};
for (int i = 0; i < RTP_MAX_NUM; i++)
{
str[i] = fgetc(fp);
}
for (int i = 0; i < RTP_MAX_NUM; i++)
{
if (i % 16 == 0)
{
printf("\n");
}
printf("%02x,", str[i]);
}
fclose(fp);