#include <iostream>
using namespace std;
struct ZongGang
{
double a;
double b;
double c;
double d;
};
void getZongGang(double& N1x, double& N2x, double& N1y, double& N2y, ZongGang& ZG)
{
ZG.a = 2.1*pow(10, 2)*(N1x*N2x + 0.7*N1y*N2y / 2) / 0.91;
ZG.b = 2.1*pow(10, 2)*(0.3*N1x*N2y + 0.7*N1y*N2x / 2) / 0.91;
ZG.c = 2.1*pow(10, 2)*(0.3*N1y*N2x + 0.7*N1x*N2y / 2) / 0.91;
ZG.d = 2.1*pow(10, 2)*(N1y*N2y + 0.7*N1x*N2x / 2) / 0.91;
}
我定义了一个结构化数据ZG,但是当我用的时候,为什么会提示我ZG越界呢?
stack around the variable "ZG" was corrupted.
using namespace std;
struct ZongGang
{
double a;
double b;
double c;
double d;
};
void getZongGang(double& N1x, double& N2x, double& N1y, double& N2y, ZongGang& ZG)
{
ZG.a = 2.1*pow(10, 2)*(N1x*N2x + 0.7*N1y*N2y / 2) / 0.91;
ZG.b = 2.1*pow(10, 2)*(0.3*N1x*N2y + 0.7*N1y*N2x / 2) / 0.91;
ZG.c = 2.1*pow(10, 2)*(0.3*N1y*N2x + 0.7*N1x*N2y / 2) / 0.91;
ZG.d = 2.1*pow(10, 2)*(N1y*N2y + 0.7*N1x*N2x / 2) / 0.91;
}
我定义了一个结构化数据ZG,但是当我用的时候,为什么会提示我ZG越界呢?
stack around the variable "ZG" was corrupted.