How about this one?
-
reading an x and y co-ordinate from a file: object.SetPosition(file.ReadFloat(), file.ReadFloat()); can you spot the mistake?
Ummm... I'm guessin' they're probably
int
s? -
reading an x and y co-ordinate from a file: object.SetPosition(file.ReadFloat(), file.ReadFloat()); can you spot the mistake?
It reads the same float twice? :confused:
My current favourite word is: Nipple!
-SK Genius
-
reading an x and y co-ordinate from a file: object.SetPosition(file.ReadFloat(), file.ReadFloat()); can you spot the mistake?
The order of reading operations is arbitrary, hence may happen that it set the position at
(y,x)
point.If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
reading an x and y co-ordinate from a file: object.SetPosition(file.ReadFloat(), file.ReadFloat()); can you spot the mistake?
Both arguments modify file so the result is unspecified. Might end up reading y, x
-
reading an x and y co-ordinate from a file: object.SetPosition(file.ReadFloat(), file.ReadFloat()); can you spot the mistake?
-
The order of reading operations is arbitrary, hence may happen that it set the position at
(y,x)
point.If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke -
reading an x and y co-ordinate from a file: object.SetPosition(file.ReadFloat(), file.ReadFloat()); can you spot the mistake?
It is bad coding style. You arn't using XML.... sorry I forget everyone doesn't subscribe to the Microsoft XML band wagon
-
reading an x and y co-ordinate from a file: object.SetPosition(file.ReadFloat(), file.ReadFloat()); can you spot the mistake?
Premature EOF would do Bad Things, I would imagine.
Software Zen:
delete this;
Fold With Us![^]