C++运行问题:The variable 'Data' is being used without being initialized.for ( int i = 0 ; i < NUI_SKELETON_COUNT; i++ )//处理骨骼ID信息{//.我把NUI_SKELETON_DATA Data;int HandRightX;放大for前面还是出现这个现象.求大侠帮忙
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/26 14:58:29
C++运行问题:The variable 'Data' is being used without being initialized.for ( int i = 0 ; i < NUI_SKELETON_COUNT; i++ )//处理骨骼ID信息{//.我把NUI_SKELETON_DATA Data;int HandRightX;放大for前面还是出现这个现象.求大侠帮忙
C++运行问题:The variable 'Data' is being used without being initialized.
for ( int i = 0 ; i < NUI_SKELETON_COUNT; i++ )//处理骨骼ID信息
{
//
.
我把
NUI_SKELETON_DATA Data;
int HandRightX;
放大for前面还是出现这个现象.求大侠帮忙,追加100分.VS2010
Run-Time Check Failure #3 - The variable 'Data' is being used without being initialized.
C++运行问题:The variable 'Data' is being used without being initialized.for ( int i = 0 ; i < NUI_SKELETON_COUNT; i++ )//处理骨骼ID信息{//.我把NUI_SKELETON_DATA Data;int HandRightX;放大for前面还是出现这个现象.求大侠帮忙
NUI_SKELETON_DATA Data;//这里没初始化
memset(&Data,0,sizeof(NUI_SKELETON_DATA));
//你这里应该还有一个赋值过程.因为你下面用到了Data
//SkeletonFrame.SkeletonData[i] 这里的 SkeletonData[i] 应该是一个NUI_SKELETON_DATA结构吧?
其实你上面没必要建一个Data 直接用SkeletonFrame.SkeletonData[i]
int HandRightX;
HandRightX = SkeletonFrame.SkeletonData[i].SkeletonPositions[NUI_SKELETON_POSITION_HAND_RIGHT].x;