Forum: C++ Feb 21st, 2009 |
| Replies: 6 Views: 788 If you don't intend to use any of the predefined C++ data types in your implementation, what do you propose to use?
A 6000 byte long number could be implemented, I would probably use an array with... |
Forum: C++ Jan 27th, 2009 |
| Replies: 1 Views: 249 Whether or not the source is available for a given library is up to the developer of the library.
If the source files are not included, you can't step into them. (Unless you like to read... |
Forum: C++ Jan 26th, 2009 |
| Replies: 1 Views: 329 I've always thought that the 'snake' collision detection just looked at the next square the snakes head was going to be put. If there's something in the square, its a collision. If its food, the... |
Forum: C++ Jan 25th, 2009 |
| Replies: 12 Views: 633 You already have a 'global' (ok so it is local to the class, but all of the class methods can see it) data area defined. See this section under private in your class:
private:
double average;... |
Forum: C++ Jan 20th, 2009 |
| Replies: 14 Views: 761 Once you 'know' what class it actually is, you can cast the pointer...
if (typeid(*pacct) == typeid(SavingsAccount)) {
SavingsAccount * pSave = (SavingsAccount *)pacct;
// or more... |
Forum: C++ Jan 20th, 2009 |
| Replies: 1 Views: 792 Note 1: Indenting is your friend, make much better use of him.
Note 2: if you're in your main() and you return, your program is done
I'm not sure what's up with the two-level menu, where you... |
Forum: C++ Jan 18th, 2009 |
| Replies: 26 Views: 1,106 I suspect your problem with multiple inheritance is actually a multiple-include problem.
If you put Freaky_Chris's example in one file, you have no problem.
If you put all 3 classes into... |
Forum: C++ Jan 17th, 2009 |
| Replies: 26 Views: 1,106 I suggested that children should never be a friend of their parent.
Parents should define anything the children should have access to in the protected: section.
I was also arguing that in this... |
Forum: C++ Jan 17th, 2009 |
| Replies: 6 Views: 425 And even that looks like something the instructor gave you. With the "do not modify" and "add code here" comments: |
Forum: C++ Dec 25th, 2008 |
| Replies: 16 Views: 1,414 Ok this will be a bit of code, but bear with me. The concepts came from the tutorial link from the earlier post and some test code I wrote to make sure I understood how it works. (I've never used a... |
Forum: C++ Dec 24th, 2008 |
| Replies: 17 Views: 989 ok, I did the default constructor and called resize(). The assert is gone and the program runs.
I also did a little more playing, I added a third player 'Bob' who is also a CPU (not that it really... |
Forum: C++ Dec 23rd, 2008 |
| Replies: 17 Views: 989 I took the zip file and made a MS project around it.
I had to add #include <algorithm> to hand.cpp but other than that it compiled.
I then uncommented your troublesome line:
void... |
Forum: C++ Dec 15th, 2008 |
| Replies: 4 Views: 939 As a note, I love using functions to help break things up. You have several things which would support that well.
1) The 'assignment' asks you to fill the board with pairs of numbers from 1-8. On... |
Forum: C++ Dec 14th, 2008 |
| Replies: 1 Views: 414 So you want the loop to keep running while the xPos is different or the yPos is different. You wrote while the xPos is different AND the yPos is different. The loop needs to run while either doesn't... |
Forum: C++ Dec 13th, 2008 |
| Replies: 42 Views: 1,960 If you're not going to use sortField, go ahead and remove it.
PS- ddanbe is right
In my sample program, the sort submenu looks like this:
sortExit = false;
... |
Forum: C++ Dec 11th, 2008 |
| Replies: 8 Views: 573 Please use code tags when posting code, preferably the language-specific version so we get syntax highlighting. It makes the code MUCH easier to read.
If you want the linked list to be ordered by... |
Forum: C++ Dec 1st, 2008 |
| Replies: 7 Views: 1,462 LPT1 is a device, you are unable to open it to read what someone else has written (or will write) to it, it just doesn't work that way.
To do what you are proposing, you would need to somehow 'get... |