|
From: David M. <dml...@co...> - 2004-07-29 13:03:31
|
Hmm, A strange error indeed.
What system type are you using? 32 or 64 bit?
What operating system?
What compiler?
What are the optimization settings?
Gavin Kalms wrote:
>Hello, I am using a float inside a struct, when I assign a number 999,999 or
>below, its fine, when I assign a number larger than that, it corrupts an
>integer I also have contained in the struct. I though maybe the float was
>overflowing, so I changed it to a double, but it still corrupts the integer.
>Anyone have any ideas what could be causing the problem?
>
>typedef struct {
> unsigned char Hour, Minute, Second;
> unsigned char Day, Month, Year;
> float DLat, MLat, SLat;//, LatOrg;
> float DLon, MLon, SLon;//, LonOrg;
> double LonOrg, LatOrg;
> char sDLat[10], sMLat[10], sSLat[10], sLatOrg[10];
> char sDLon[10], sMLon[10], sSLon[10], sLonOrg[10];
> int InsertNum, Depth, Interval, Data[40];
>} CP40InStruct;
>
>LonOrg and LatOrg are the 2 that I changed to double, InsertNum is the
>variable that becomes corrupt when numbers larger than 999,999 are placed
>into LonOrg or LatOrg.
>
>Thanks
>Gavin
>
|