gpt4 book ai didi

c++ - 未知段错误

转载 作者:行者123 更新时间:2023-11-28 03:11:02 25 4
gpt4 key购买 nike

<分区>

运行以下代码时出现段错误:

const int SENSORS = 65;
static float coefficient[SENSORS][6];
const int NUMSUBSYSTEM = 6;
const int ALLSENSORS = SENSORS * NUMSUBSYSTEM;
using namespace std;

int row = 0;
static int outputError = -1; //static to retain value

ifstream equationFile("equation.txt");

static string sensorNameEquation[ALLSENSORS];
static float coefficientOverride[ALLSENSORS][6]; //static to keep large array off stack
static string dependantSensor[ALLSENSORS]; //static to keep large array off stack
static float baseTemp[ALLSENSORS]; //static to keep large array off stack

printf("Total sensors: %d\n", ALLSENSORS);

row = 0;
if(equationFile)
{
while( equationFile >>
sensorNameEquation[row] >>
coefficientOverride[row][0] >> coefficientOverride[row][1] >>
coefficientOverride[row][2] >> coefficientOverride[row][3] >>
coefficient[row][4] >> oefficient[row][5] >>
dependantSensor[row] >> baseTemp[row])
{
row++;
printf("sensors: %d\n", row);
}

equationFile.close();//done reading from file...close it
}

它到达方程文件的第 102 行,然后出现错误。知道为什么会这样吗?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com