![]() |
Re: OT: Stupid c++
Anybody want to volunteer to look at the code?
|
Re: OT: Stupid c++
Sure, though I'm not that great with C++, I might be able to spot something...
|
Re: OT: Stupid c++ (Roguelike development)
Why would new re-assign what same pointers?
|
Re: OT: Stupid c++
And now it isn't even getting past re-sizing the character array.
Why are you using character arrays at all? There is no reason to ever use them over string. Any time you need to pass a char* to a function, just use the .c_str() member on your string (aka: crazy_function(mystring.c_str()). C++ is stupid. C++ is neither stupid nor smart. It all depends on how you use it. Why would the 'new' operator re-assign the same pointers? I don't understand the question. New doesn't assign any pointers; it creates an object in the dynamic memory space (heap), and returns a pointer to it. |
Re: OT: Stupid c++
By character array, I mean an array of NPC's and PC's. And technically I should have said 'vector'.
C++ needs more comprehensive error checking. Tomato, tomato. Anyone who wants to see the source code, PM me, thanks. |
Re: OT: Stupid c++
C++ compilers have more error checking than most other languages (esp. g++ with things like -pedantic flags). And anyways, you can always add more by throwing and catching exceptions.
|
Re: OT: Stupid c++
It doesn't tell me why the resize function wasn't working on the character vector! Obviously, it's not fully-featured! http://forum.shrapnelgames.com/images/smilies/laugh.gif
|
Re: OT: Stupid c++
Why are you using a resize function anyways? push_back() works well.
|
Re: OT: Stupid c++
Because, with resize you don't have to push_back something.
|
Re: OT: Stupid c++
Why would you increase the size of a vector without having something to add to it?
|
All times are GMT -4. The time now is 09:47 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.