0
我想通過這在我的功能,但是在進入功能型前事情錯傳遞一個字符串與指針/一個函數C
FILE *f = fopen("out.bmp", "rb");
int countBit = 0;
int size = 0;
char* type;
for (int i = 0; i < 54; i++)
fgetc(f);
printf("/* count bit to pixel */\n");
scanf("%d", &countBit);
size=DecodeInformationSize(f, countBit);
type=DecodeInformationType(f, countBit);
DecodeMessage(f,countBit,size,type);
但經過:
void DecodeMessage(FILE *f, int countBit, int size, char* type)
{
char messageSize[8];
char nameOut[15] = "outMessage.";
strcat(nameOut, type);
char* message = (char*)malloc(size * 8);
請說明問題