Type: Posts; User: monarch_dodra
Search took 0.07 seconds.
That thread was 12 years old.
The account was created specifically for that single post... Which contains a link to a .exe on a file sharing website...
Speaking of which, isn't giving links to...
How did you print your top row to the correct size? for loops. Just do the same, but printing spaces. BTW, at this point, using named functions might (if you are comfortable with it) make coding...
Just in case it wasn't clear, you "lineup" the boundaries by printing extra spaces. You aren't asked to move the cursor around or anything like that.
Right, start slow.
But you'd still need a form of nested loop though, even if you process first and last individually though?
I'd also recommend using the named functions "printFirstLast" and...
Just start slow, and improve little by little. For example, this will print a rectange:
for (int i = 0 ; i < northSouth ; ++i)
for (int j = 0 ; j < eastWest ; ++j)
October 16th, 2014, 03:17 PM
You *just* defined the Array1D class. Why aren't you using it in your Array2D class? Array1D<Array1D<T>*>
October 16th, 2014, 11:11 AM
erase remove is stable, but requires o(n) writes on average.
If you don't need a stable erase, and have only few elements to remove, then "swap with back and pop" is also always a good choice.
October 15th, 2014, 01:53 PM
For starters, itoa is non-standard.
I don't know why it returns a string. However, you should yourself understand why it must at least take a string as in input argument.
October 15th, 2014, 12:14 PM
Hum... I must have been thinking of list.erase. Weird that map didn't have this behavior in C++98. Seems like a blatant oversight?
October 15th, 2014, 12:10 PM
Wasn't that the recommended way to do it in c++98 too? I've never seen the postfix approach before. Scott Meyers recommends it too in Effective STL.
October 15th, 2014, 09:27 AM
Would generating UUIDs be acceptable? It's manual, but it is real stable and works on all platforms.
October 15th, 2014, 09:19 AM
The map iyself migh not be corrupt, but iterator increment is only valid if the iterator points to valid data. Are you, by any chance, removing elements as you are iterating? Removing elements while...
October 12th, 2014, 11:16 AM
No offense, but please understand what "base 10" means before typing random code. What the heck is "% 45" or "/ 500"? It's not even a mistake, it just makes 0 sense. But at least its a first step.
October 11th, 2014, 04:29 PM
Right, but every segment "lowers" the end distance. So it remains equivalent. It's worded in terms of "paying" per segment, and having the highest amount left at the end. It's a double negative.
October 11th, 2014, 12:23 PM
Good idea. I'd have rated, but "You must spread some Reputation around before giving it to superbonzo again." :)
October 10th, 2014, 08:35 AM
I don't want to lash out or anything, but the fact that you'd *try* to implement a "smart pointer", and *then* ask these questions simply boggles my mind. I will stop my train of thought here.
October 9th, 2014, 04:02 PM
You don't need the implementation to resolve. All you need is the signature: "SP* operator->();". This resolves just fine. However, it's "Display()" that doesn't resolve. Compiling the function*body*...
October 9th, 2014, 03:40 PM
The "maze" as you describe it, seems to be a generic graph, with no particular topology? In this case, I don't *think* there's much faster than dijkstra.
That said, I don't think you need to...
October 9th, 2014, 03:21 PM
In C++, the functions declared inside the body of a templatized struct/class are only compiled *if* they get used. They don't create compile errors until they are actually used and needed.
September 26th, 2014, 03:24 PM
Well, I wasn't yet ready to take it back then, and made no assumptions that I'd nail the test.
I've since studied up on them, and would like to know what I *still* don't know ;)
September 25th, 2014, 10:00 AM
You have picked my interest. I would like to take that test. Could you PM me a copy (I won't share with anyone)? If I fail, I'll wear the crown in my sig ;)
September 24th, 2014, 05:50 AM
Please don't update your code after you have been given answers. Rather, post updated code in your replies. I come to this thread, and I now have no idea what is going on, what the problem was, or...
September 24th, 2014, 05:47 AM
Oh wow! I had no idea!
int a00 : 1;
char a01 : 1;
int a02 : 1;
September 24th, 2014, 05:37 AM
The idea is not that you are supposed to *specialize* distance (which is a function, and partial specialization is illegal anyways). Rather, you are supposed to *overload* it, and the use Koenig...
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.