I keep getting the “debug assertion failed” error when i debug my code
It seems to fail at the sprintf line in the function below:
void GetReference(int side)
{
for (int j=0; j<exposeNumber; j++)
{
image = cvQueryFrame(capture); // get the first frame of video
sprintf(fileName, "RefImage%i", (side*exposeNumber + j));
cvSaveImage(fileName, image);
wait(200);
}
}
“exposeNumber” is equal to 5 and “side” can either be 0 or 1
Cheers
Chris
fileNameMUST be big enough. And achar*. And notNULL. For example:or
Or something smaller here. As I see, I guess 32 or 64 would be big enough.
I’m pretty sure the assertion fails because of
NULL(or0, which is the same here) pointer (fileName)