Forum: C++ Sep 1st, 2006 |
| Replies: 9 Views: 6,106 For a while loop, the iterator (typically int i) is incremented at the end of the loop. Then, you can use i + 1 as your denominator in calculating the average, and do the cumulative sum of the... |
Forum: C++ Sep 1st, 2006 |
| Replies: 9 Views: 6,106 Sounds like you could use an array to store all those numbers, then have an int sum that you'd use to hold the cumulative sum of the temperatures as you looped through the array.
Something like... |
Forum: C++ Jun 19th, 2006 |
| Replies: 3 Views: 1,581 As I (eventually) figured out, with inspiration from Wolfpack's reply, making sure to explicitly mark the image for closing and garbage collection solved the problem nicely.
Thanks for the... |
Forum: C++ Jun 17th, 2006 |
| Replies: 3 Views: 1,184 Good to know. Thanks, Dave! |
Forum: C++ Jun 17th, 2006 |
| Replies: 3 Views: 1,184 The first version you posted is explicit, and, in my limited experience, is unnecessary.
Just use the second version if you have no input arguments; there's no difference. |
Forum: C++ Jun 17th, 2006 |
| Replies: 3 Views: 1,581 That looks to be just about what I'm interested in; however, with regards to the PictureBox control specifically, how would you force it to release the file that has been set to its image attribute?... |
Forum: C++ Jun 16th, 2006 |
| Replies: 3 Views: 1,581 This is an offshoot of a specific problem I've posted in the C# forum.
However, it applies to C++ as well.
If you have opened a file, specifically, an image file, but would like to rename (or,... |
Forum: C++ Apr 24th, 2006 |
| Replies: 19 Views: 2,528 I knew there was something evil about you... |
Forum: C++ Apr 10th, 2006 |
| Replies: 10 Views: 7,187 All I can think of is a really annoying set of dynamically-allocated arrays. Or a linked list.
Or, determining what the maximum length is, finding all the words that are that long, creating a loop... |
Forum: C++ Apr 4th, 2006 |
| Replies: 14 Views: 3,328 ... There's 12 boards. Fine. 6n+4 is correct, And my approach won't quite work. You'd need a single function that checks a single layer, then feed in the layers appropriately...
Or am I thinking... |
Forum: C++ Apr 4th, 2006 |
| Replies: 14 Views: 3,328 Okay, I'll conceed the +4, and that the equation 4n+4 will apply to evens as well as odds.
But could you please explain how a square can have more than two unique diagonals? |
Forum: C++ Apr 3rd, 2006 |
| Replies: 3 Views: 3,648 It's a CWnd base, correct?
How about 'SetForegroundWindow'? (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_cwnd.3a3a.setforegroundwindow.asp) |
Forum: C++ Apr 3rd, 2006 |
| Replies: 14 Views: 3,328 Assuming you're only doing odd-number size cubes (3x3, 5x5, 7x7, etc):
I suggest the following approach.
For the cube itself, there are two full-diagonal wins.
If you think of the n x n cube... |
Forum: C++ Apr 3rd, 2006 |
| Replies: 14 Views: 3,720 How about serialization or XML? Would those help?
As Lerner said, the problem is that if you have to make a dramatic change, you have to move the whole file.
You have an option here, though.... |
Forum: C++ Apr 3rd, 2006 |
| Replies: 12 Views: 2,209 I'm fond of simple games...
Are you familiar with mastermind? You could play it with letters rather than colors if you're not comfortable with programming graphical elements.
How about the... |
Forum: C++ Mar 31st, 2006 |
| Replies: 12 Views: 1,694 ...
Yes.
Yes, I am.
Showoff. |
Forum: C++ Mar 31st, 2006 |
| Replies: 12 Views: 1,694 I'm not a student, and I got plenty of help.
You just need to know how to ask the questions.
Look at the links at the top of the forum to help you get started. If you have a thread topic that's... |
Forum: C++ Mar 31st, 2006 |
| Replies: 3 Views: 1,935 You could create additional pointers to the linked list that you assign during the search functions (Pass the pointers as parameters).
Then, once you've searched, you can continue to bring up... |
Forum: C++ Mar 28th, 2006 |
| Replies: 5 Views: 1,313 Quick related question: Should I go with Dev C++ 4 or the beta version of 5? |
Forum: C++ Mar 28th, 2006 |
| Replies: 7 Views: 5,696 Yes, just follow this link:
http://www.daniweb.com/techtalkforums/announcement8-2.html
In this case, if you really have no idea where to start, I suggest you first at least try to write out what... |
Forum: C++ Mar 26th, 2006 |
| Replies: 14 Views: 1,834 Sir, I apologize.
I, too, like to discuss things in person. Preferably with a big white board to draw on. However, bridging the gap between online and real life communication makes me uneasy,... |
Forum: C++ Mar 24th, 2006 |
| Replies: 14 Views: 1,834 Um... Don't take this the wrong way, I completely understand the desire to have 'face time', but asking if you can come talk to them so soon after starting to post on a board strikes me as slightly... |
Forum: C++ Mar 24th, 2006 |
| Replies: 14 Views: 1,834 I'm speaking from ignorance here, but:
Unless VC++ 8 is incredibly different, most of the things you'll need to know can be found in older books.
Even if you're developing graphical user... |
Forum: C++ Mar 24th, 2006 |
| Replies: 14 Views: 1,834 Agreed.
Two quarters (6 months) "Learning" C/C++ in college didn't help me even a tenth as much as hanging out around here and reading reccomended materials/doing exercises/making test code for... |
Forum: C++ Sep 30th, 2005 |
| Replies: 3 Views: 4,114 May I suggest you not necro-post and instead make a new topic? |
Forum: C++ Sep 27th, 2005 |
| Replies: 2 Views: 1,584 http://www.daniweb.com/techtalkforums/showthread.php?t=30332
Read it (specifically, read my last post with a lot of commented code). Pay particular attention to the cleanup automation, and look at... |
Forum: C++ Sep 26th, 2005 |
| Replies: 6 Views: 1,266 It would be easiest to check the list beginning to end to see if you have the value already, then not make the node if there's already one with that value. |
Forum: C++ Sep 26th, 2005 |
| Replies: 6 Views: 2,963 So, what's the problem with Linked lists? Just don't understand how they work, the code to make one, or something else?
I wrote what I think is a pretty good starter guide to linked lists a while... |
Forum: C++ Sep 22nd, 2005 |
| Replies: 6 Views: 7,503 Nice to hear from you again. Looks like you've really improved!
Unfortunately, my schedule is much tighter these days, so I don't have the time to help you out explicitly, but perhaps this may... |
Forum: C++ Sep 20th, 2005 |
| Replies: 7 Views: 11,287 Heh. I just can't win...
First, MFC.
Then, trying to use an old piece o' Schlidt's as a reference.
Now, I find out the compiler's crummy.
Thank goodness for this forum. I'd probably be a lot... |
Forum: C++ Sep 20th, 2005 |
| Replies: 2 Views: 1,251 Whenever you see 'Unexpected end of file', you'd do well to go back over your functions and classes to see if you've missed a bracket.
It's a subtle error when you've been sitting in front of a... |
Forum: C++ Sep 19th, 2005 |
| Replies: 7 Views: 7,363 Thank you very much. That's exactly what I needed. |
Forum: C++ Sep 19th, 2005 |
| Replies: 7 Views: 7,363 Okay, let me try this again.
I want to know how to implement a map inside a class.
This map will use a CString data type as the keys. This map will use a CString data type for value associated... |
Forum: C++ Sep 19th, 2005 |
| Replies: 7 Views: 7,363 It's just that for MFC, the code's all over the place, but I'll try.
In Document:
//Map declaration (Eventually, determine if config file for this file exists
//and load map at file... |
Forum: C++ Sep 19th, 2005 |
| Replies: 7 Views: 7,363 All right. I'm not very good with pseudo code, but there's no need to cloak and dagger this stuff.
In the header, as part of my MFC app's document class:
typedef pair <const CString,... |
Forum: C++ Sep 19th, 2005 |
| Replies: 7 Views: 7,363 Hello, all. Rather urgent question.
I'm trying to implement a simple Cstring/Cstring map in my application so users can specify what they want to see instead of the MAC address.
The... |
Forum: C++ Sep 15th, 2005 |
| Replies: 6 Views: 2,861 No.
It's far better to fail in the attempt than to not understand what you're doing.
Also: There's a topic at the top of the forum that states:
"We only give help to people who show effort."... |
Forum: C++ Sep 15th, 2005 |
| Replies: 6 Views: 2,861 Ahhh... I hope you're using C++, that'll make things much easier than in C...
Make a struct or class that stores the word and a counter, and put them in a vector or somewhere.
Why not store... |
Forum: C++ Sep 15th, 2005 |
| Replies: 6 Views: 2,861 Sure, if you post the code (copy and paste it inside of (code) (/code) tags, but use [ and ] rather than ( and ) ), we'll help you.
One thing that will help you on your way is to consider how you,... |
Forum: C++ Sep 15th, 2005 |
| Replies: 6 Views: 16,288 Isn't there a topic at the top of the forum about good C/C++ books?
Whatever you do, avoid anything written by Herb Schlidt. (Thanks again, Dave!)
He's easy to read, but chock full o' errors. |