必须要在外面malloc
#include <iostream>
using namespace std;
void a(unsigned char* m_pBufForSaveImage){
// m_pBufForSaveImage = (unsigned char*)malloc(100 * 100 * 3 + 2048);
*m_pBufForSaveImage = 100;
std::cout<<+*m_pBufForSaveImage<<" "<<+*(m_pBufForSaveImage+1)<<std::endl;
}
int main(){
unsigned char* srcImg;
srcImg = (unsigned char*)malloc(100 * 100 * 3 + 2048);
// unsigned int m_nBufSizeForSaveImage = 100 * 100 * 3 + 2048;
a(srcImg);
std::cout<<+*srcImg<<" "<<+*(srcImg+1)<<std::endl;
}