CString Format问题 在线等!
程序编译没有问题,但是在运行中出错!出错提示
struct individual
{
double fitness;
double *variable;
};//结构体声明
individual BEST;
//程序其他部分,BEST赋值(variable是数组指针 也new空间 并进行了赋值)
.........
//
CString str;
str.Format("当前算法优化的最大函数值是:%e",BEST.fitness);
CFile f;
f.open("txt\\数据.txt",CFile::modeCreate|CFile::modeWrite);
f.Write(str,str.GetLengh());
//
..其他代码
//
运行是报错strex.cpp line672之类的错误
跟踪就是在str.Format出错,而且有的地方就是有的时候报错 有的时候不报错!
百思不得其解!
大虾和高手多帮忙啊!