Ah yes & fixed it. I was forced to use the function prototype
void insertOrder (dnode<T> *header, const T& item)
I figured I wasn't passing the values correctly and it was only copying the...
Type: Posts; User: Shadowwoelf
Ah yes & fixed it. I was forced to use the function prototype
void insertOrder (dnode<T> *header, const T& item)
I figured I wasn't passing the values correctly and it was only copying the...
For some reason my function isn't changing the pointer I send to it.
void insertOrder (dnode<T> *header, const T& item){
header=new dnode<T>(item);
}
//main
dnode<int> *tree=NULL;
Once I added const in front of the temporary pointer it suddenly started to work so thanks for the help.
I can't seem to understand whats wrong with my program. I keep getting this linker error.
error LNK2019: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char>...
Well the run function for my states runs the update function then the render function in order. I guess I could run it from the engine and save some memory and then I only have to pass the engine...
So should I do it like this?
Main
Engine Engine
...
Loop
Message pump
Engine.run();
....
But if I pass around the Engine class by reference wouldn't that defeat the purpose of not passing around the vector by reference?
Well I didn't think I should start a new thread since this thread caused all the problems, but I am having trouble figuring out how to manage the vector.
If I create a separate class called Engine...
Guess I'll have to rethink most of my coding. Hopefully this will give me less headaches :o Thanks for the help
Well the game I set my gameloop up I need the vector to be in main.
while(done!=TRUE) // Loop That Runs While done=FALSE
{
if (PeekMessage(&msg,NULL,0,0,PM_REMOVE)) // Is...
Right now that vector is in the Main().
Well I am confused on what you mean by its own vector.
Yea it should be bound to the one in the Main() but I have no idea on how to do it
edit(Just to clarify): basically I want to be able to modify my original vector from within my classes.
I was trying to make it so that States(private) would get the reference, but I guess that is where my code is screwing up.
States is a private variable used by update to push/pop additional states.
class MENU_STATE: public baseGameState{
private: //All of our variables that the update function and...
I cannot seem to figure out how to pass by reference my vector of pointers. I think I am doing it right and I have tried searching google/ the forums, but I am at a loss.
Here is my code
...
Well to save looping time you can always use a sleep() function. altho if you sleep too long you might miss a few mesages, but it will definitly save some cpu power. Mine used 100% and now it...
I recently talked to my internet provider and they told me I have a 1.5-3.0mb service, which I thought can't be right. So I ran a few speed tests from various websites and they all say I have a ...
I'm learning opengl and I don't quite understand what the hdc and rdc do. Here's what I believe they do.
So you have multiple programs running thus multiple windows. So whatever is your main...
Then what does redbook even mean?
I looking to buy a beginners opengl book and I was wondering if this is a good book to buy or is this more for experts? (Also I know the basic of windows programming but... thats about it)
Heh sorry I meant binary trees. I never heard of skip lists though. So when do you know when an object is too big for a vector?
I was wondering when you should actually use these lists? or when you should want to avoid them? Thanks for helping me try to sort out these concpets
Figured it out. Salem your entire post about Buffer overflow reminded me to look at where the temporary buffer is storing its data which of course was outside of its domain.
I know the maximum buffer size(Unless my teacher decides to purposefully crash the program)which is 900. Adding the '\0' didn't seem to help at all. Also I know that it might not work the second or...