为什么每次执行结果都不一样??????????

void Hog::Debug(int w, int h)
{
double* buffer;
ofstream testout;

testout.open("C:\\Users\\Administrator\\Desktop\\training1.txt",ios::out);//以添加模式打开文件

for(int i=1;i<=100;i++)
{

char filePath[100];
sprintf(filePath,"C:\Users\Administrator\Desktop\image\%d.bmp",i);

unsigned char* testinput1 = read_bmp_image(filePath);
ImageProperty image_property1 = get_image_property(filePath);

Init(image_property1.width,image_property1.height,testinput1);

delete []testinput1;
testinput1 = NULL;
unsigned char* testoutput1 = new unsigned char[image_property1.size];
 buffer= FeatureExt( testoutput1 );



for( int i = 0 ; i < 108 ; i++ )
{
    testout<<buffer[i]<<" ";
    if((i+1)%w ==0)
    {
        testout<<endl;
        testout<<endl;
    }

}

}
testout.close();

FeatureExt 是什么功能,怎么没有看到源代码?

请Debug下自己单步调试一下

可以在程序运行中各段打印结果,可看出哪里异常。

没有显示不结果的情形

实在不行用printf调试下,暴力调试