Nic*_*sui -3 c++ struct function parameter-passing
这是我在做的事情:
在single.h文件中定义了一个struct:
typedef struct
{
double x,y,z;
}PhysicalSize;
Run Code Online (Sandbox Code Playgroud)
此结构用于single.cpp文件中
PhysicalSize physicalSize;
physicalSize.x = xstageStepSize;
physicalSize.y = ystageStepSize;
physicalSize.z = zstageStepSize;
long SaveTIFFWithOME(wchar_t *filePathAndName, char * pMemoryBuffer, long width, long height, unsigned short * rlut, unsigned short * glut,unsigned short * blut,
double umPerPixel,int nc, int nt, int nz, double timeIncrement, int c, int t, int z,string * acquiredDateTime,double deltaT,
string * omeTiffData, AcquireSingle::PhysicalSize physicalSize)
Run Code Online (Sandbox Code Playgroud)
我介绍了这个功能,看起来很好,所有人physicalSize.x, physicalSize.y and physicalSize.z都有正确的价值.但是,当我迈步时SaveTIFFWithOME(),所有physicalSize.x, physicalSize.y and physicalSize.z看起来都很奇怪,好像它们从未被初始化.
我想知道我做错了什么,以及将结构作为参数传递给函数的正确方法是什么?谢谢.