|
How else are you going to debug auto-increment?
|
# ¿ Apr 17, 2012 14:55 |
|
|
# ¿ May 2, 2024 02:43 |
|
Vanadium posted:How does all of this interact with taking a char* pointer to the beginning of a large struct and then accessing it byte for byte? Yeah does the type of the pointer change things? Or is it well-defined as long as you stay within the struct or 1 past the end, regardless of the type of the pointer?
|
# ¿ Feb 6, 2014 00:15 |
|
Is that just a timing thing? It could change between the call and the access?
|
# ¿ Feb 19, 2014 08:59 |
|
leper khan posted:if (!(foo > 0)) { int or float? I use that form if it's a float and I want to catch NaN too. Maybe I'm the horror?
|
# ¿ Mar 27, 2014 01:37 |
|
Style rules and appropriate collection type for purpose are two different issues. If you're looking to perform a variety of queries on a data-set large enough that searching through all the elements is a performance problem then Dictionary is the wrong collection type. If a Dictionary<Year, Dictionary<Month, Data>> is the appropriate collection type then it comes down to a trade-off between the boilerplate necessary to do it stylishly and the benefits.
|
# ¿ Apr 1, 2014 01:33 |
|
Yeah that's pretty typical for a game character class in any game let alone an RPG. You can bet each function in that class ended up reading from and writing to many aspects of the character, and that those rules were probably changing every day during the pre-production phase when they were experimenting with how the game would play. Sometimes you get a chance to go back and refactor out anything that can be, but that's rare when there are bugs that will actually impact consumers to fix.
|
# ¿ Sep 22, 2014 01:39 |
|
Yeah just narc on your classmates, you dummies. How could that possibly backfire?
|
# ¿ Jan 2, 2015 21:52 |
|
|
# ¿ May 2, 2024 02:43 |
|
For practical purposes, char is just C/C++'s name for byte. I think sizeof(char) == 1 is in the spec. And yeah it's nice for there to be a contract that T* points to a valid T in memory as long as you don't do anything undefined.
|
# ¿ Mar 9, 2015 06:41 |