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/15 22:51:30
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前面还是出现这个现象.求大侠帮忙
xSQoP+71qX#! 1YRn E{ `$6 60޶<mQ-AK=}rL<6&Ufe;:q^pELy9HQ` Db<)#q ƨTXHF< p  HY6x m6`i|SQ= ^Yj*5;Tunq>J\|PjE&Օz&~9mRR'_4pg4Cx` _6ŸN0xw653 yi3x,?͢$8| 8f sL2NbN`i9*T/M\ǭ2|00)@rW3vLZ\CZ`Uyƒ;}ڒDׇTPe 5T2BqDu1Tx&2\R"`-É/&31ŤV={p ›qPR"JtM>:.P*D捪&&b(7BSٴ/,^`>~rH.QNZHsK_󟶶t

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;