No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
5 Posted Topics
Re: I would try to solve the sub-problem of finding all character permutations in a string of a given length (l) that consists of n ones and l-n zeros. Then it's easy to just solve the problem first for n=1 and then increment n until it reaches l. Try that approach … | |
I have a silly problem. I want to make a class (let's call it Classone) that has an object that's an instance of Classtwo as an attribute. So far so good, but when Classtwo has an attribute that's an instance of Classone, I get a compilationerror. I would appreciate if … | |
Re: Without being an STL-wizard myself, it appears to me that you are filling the list with pointers to the same array of characters every time, and replacing the data in this array with the latest word. This ought to give you the behaviour you describe. What you need to do … | |
Re: The size of the array has to be known when compiling. That's why it must be a constant. The only way around this (that I know of) is allocating the array dynamically. | |
Re: I haven't tried the code myself, but at a quick glance, I'd say that you need something like this: [code] if (x < s) s = x; else if (x < y) { s = y; y = x; } [/code] |
The End.