|
I have a bit of code that I'm working on, and it has a use of '&' that I've never seen before. quote:switch(rand()&3) I've seen rand() % 3 used a million times before, but never the &. It's still giving me random numbers but it seems like it's doing something a bit different. What does this do?
|
# ¿ Mar 3, 2008 05:48 |
|
|
# ¿ Apr 28, 2024 21:24 |
|
Argh. I'm wanting to write a bit of code to keep track of statistics about my memory pool. I want to set up this UpdateMemoryStats function as a global so I can call it anywhere (or in the main loop) and I only want one set of stats, so I figure I should make the stats static. Unfortunately I keep getting a drat unresolved external symbol error. I'm obviously missing something... I've gone over this a bunch and I think I just need someone else to look at this or something. Or if there's a better way to do this just suggest that. code:
|
# ¿ Jun 20, 2008 18:51 |
|
In a C# application I'm wanting to make a class that has a List as a member, but I keep running into the issue that if I try to add some items to the List, but I run into the issue that the list is null. I thought that maybe I had to instantiate the list in the constructer of the class, but that didn't work either. I'm missing something obviously.code:
code:
|
# ¿ Jul 15, 2008 17:15 |
|
DLCinferno posted:But you're not instantiating it. You need to do either Ahh I knew I needed to create the list in some way. I actually had written in code:
in the constructor and that didn't work. Changing it to: code:
worked since I had already declared m_Stufflist earlier.
|
# ¿ Jul 15, 2008 18:03 |