运行时检查失败#3 - 正在使用变量'结果'而未被初始化 [英] Run-Time Check Failure #3 - The variable 'result' is being used without being initialized
本文介绍了运行时检查失败#3 - 正在使用变量'结果'而未被初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有我的代码问题...程序编译,但它然后提供以下语句运行时检查失败#3 - 变量'结果'正在使用而不被初始化。然后在那一点结束程序。我试图运行该函数后所拥有的所有内容都将被忽略。我应该怎么做?
Having issues with my code... the program compiles, but then it gives the following statement "Run-Time Check Failure #3 - The variable 'result' is being used without being initialized." It then ends the program at that point. Everything I have after trying to run the function is ignored. What should I do?
double result;
for (int i=0; i<nRows; i++)
{
absum.push_back(vector<double>());
for (int j=0; j<nColumns; j++)
{
double temp;
temp = matrixa[i][j]+matrixb[i][j];
absum[i].push_back(temp);
cout << temp << '\t';
}
cout << endl;
}
return result;
推荐答案
有时候C ++对此有点挑剔, code> double result = 0 ?
C++ is picky about this sometimes, have you tried double result = 0
?
这篇关于运行时检查失败#3 - 正在使用变量'结果'而未被初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文