How to save a cam snapshot?

there is no >> operator for raw pointers here,
but, if you know width, height and type, you can setup a cv::Mat like:

Mat img(h, w, CV_8U); // preallocated 8bit grayscale

// and read your data directly into that
ASIGetDataAfterExp(CamNum, img.data, imgSize);

// Now save the frame into a file
imwrite(“test.jpg”, img);