如题:小弟碰到了一个困扰了多天的问题strcpy(GPS_Data[i].La
titude,"0000.0000");
strcpy(GPS_Data[i].Longitude,"0000.0000");
strcpy(GPS_Data[i].NS,"N");
strcpy(GPS_Data[i].EW,"E");
strcpy(GPS_Data[i].Speed,"000.0");
strcpy(GPS_Data[i].Course,"000.0");
DisText(470, 329,0,1,GPS_Data[i].Latitude);
DisText(470, 349,0,1,GPS_Data[i].Longitude);
DisText(470, 369,0,1,GPS_Data[i].NS);
DisText(520, 369,0,1,GPS_Data[i].EW);
DisText(470, 389,0,1,GPS_Data[i].Speed);
DisText(470, 409,0,1,GPS_Data[i].Course);
上面的GPS_Data[m].Course之类的是我定义的一个结构体数组,然后数组里又有Course等数组成员。
问题是我现在发现每次在屏幕上显示这几个成员数组数值时,发现打印结果都是同一个数值。
如果用下面的方法就不会出现上面的问题,能够正常显示:
DisText(470, 329,0,1,strcpy(GPS_Data[i].Latitude,"0000.0000"));
DisText(470, 349,0,1,strcpy(GPS_Data[i].Longitude,"0000.0000"));
DisText(470, 369,0,1,strcpy(GPS_Data[i].NS,"N"));
DisText(520, 369,0,1,strcpy(GPS_Data[i].EW,"E"));
DisText(470, 389,0,1,strcpy(GPS_Data[i].Speed,"000.0"));
DisText(470, 409,0,1,strcpy(GPS_Data[i].Course,"000.0"));
到底什么情况???strcpy返回的不就是数组GPS_Data[i].Speed等的地址吗?蛋痛。。。。各位大神们,跪求解释~~~~
一周热门 更多>