Forum: C++ Sep 18th, 2008 |
| Replies: 12 Views: 746 Okay, I got it, worked like a champ. Thanks for the advice, it worked fine. |
Forum: C++ Sep 18th, 2008 |
| Replies: 12 Views: 746 Here's the spot I'm having trouble with inside the merge sort, I'm not sure what happens inside the statement now
while((indexx < 50) && (indexy < 50) && (indexz < 50))
{
... |
Forum: C++ Sep 18th, 2008 |
| Replies: 12 Views: 746 did that already, errors gone. Now how is array z brought into the mix?...other than adding it to the argument list.
Is it compared to x and y as well, or is it somehow compared to bigarray? ... |
Forum: C++ Sep 18th, 2008 |
| Replies: 12 Views: 746 yes, it comes up with y first, then z. It's definitely something I did in merge sort, when I comment it out I get no errors.
here's the merge sort that I messed up
void merge_sort(int x[], int... |
Forum: C++ Sep 18th, 2008 |
| Replies: 12 Views: 746 Okay, removed k completely, set j to be the index of big array in all three loops.
I no longer get the error for x, only for y and z. The error comes up in a windows dialog box and says
"run... |
Forum: C++ Sep 18th, 2008 |
| Replies: 12 Views: 746 altered to match what you posted (for z as well, misunderstood)
Still gives me that error for y and z? |
Forum: C++ Sep 18th, 2008 |
| Replies: 12 Views: 746 I think I see what you mean with the incrementing i++ for x j++ for y and say k++ for z. I thought it might have something to do with the counts, but I couldn't see where I was off. I didn't think... |
Forum: C++ Sep 17th, 2008 |
| Replies: 12 Views: 746 I'm doing a lab where I must use three sorting methods, then merge sort the three arrays. While separating the larger array, I'm getting a
"run time check error #2 stack around the variable x was... |
Forum: C++ Aug 29th, 2008 |
| Replies: 2 Views: 364 You are correct V, data structures covers all those things. I am currently in a DS class myself and use MS Visual Studio 2005, although now many schools probably use 2008 by now.
I'm not sure... |
Forum: C++ Aug 28th, 2008 |
| Replies: 6 Views: 1,580 Thanks for the heads up Vernon. BTW I figured out the linked list thing thanks to your tips on the node class and how data was being passed in. |
Forum: C++ Aug 28th, 2008 |
| Replies: 6 Views: 1,580 okay, I understand most of what you've done, what does including the windows.h file give me? I've never used it before |
Forum: C++ Aug 28th, 2008 |
| Replies: 6 Views: 1,580 The problem may be in my print function as well. I have it printing using the index, so it doesn't print out empty elements. Now I'm trying to delete the front element in the code above, and it... |
Forum: C++ Aug 28th, 2008 |
| Replies: 6 Views: 1,580 How do you delete the front cell of an array in an array based circular queue?
Here's the Queue cpp functions
#include <iostream>
#include <string>
#include "Contributor.h"
#include... |
Forum: C++ Aug 28th, 2008 |
| Replies: 10 Views: 1,053 Phil,
I have your queue stuff all figured out except for one thing, and I'll post that as a separate question. |
Forum: C++ Aug 28th, 2008 |
| Replies: 19 Views: 2,202 Vernon, thank you for your help. I finally figured it out. I was using assignment in a couple places where I meant to be doing comparison/equality |
Forum: C++ Aug 28th, 2008 |
| Replies: 2 Views: 389 Now mark your post as solved...lol. |
Forum: C++ Aug 22nd, 2008 |
| Replies: 19 Views: 2,202 The list class does indeed do most of the work. All my list manipulation happens there (insert etc)
It is an ordered list, and the insert puts everything in the correct order. With the current... |
Forum: C++ Aug 22nd, 2008 |
| Replies: 19 Views: 2,202 so as usual..I overcomplicated it for myself...ookay...try again I guess...lol
do I even need a copy constructor in the node class?
and I took out the references to next in the node class.
... |
Forum: C++ Aug 22nd, 2008 |
| Replies: 19 Views: 2,202 well...yes...all I did was add line 7.
I'm really making a mess of this aren't I? Could that be what's killing the program when it runs?
The more I change, the more lost I get
#include... |
Forum: C++ Aug 22nd, 2008 |
| Replies: 10 Views: 1,053 got the overloaded = function fixed, but still not sure how to pass the contributor object into the enqueue function |
Forum: C++ Aug 22nd, 2008 |
| Replies: 19 Views: 2,202 okay, I made pnext a data member of node, and I corrected all the pNexts and made them pnext.
Now, it will print all the inserts fine, but then the program ends and gives me an error dialog box... |
Forum: C++ Aug 22nd, 2008 |
| Replies: 19 Views: 2,202 bah...I attached the wrong cpp file. try this one
and it should be asking for ContributorClass.h no space, add a space, whichever...I caught it after I attached it |
Forum: C++ Aug 21st, 2008 |
| Replies: 19 Views: 2,202 Vernon,
Here is the code you requested. I would have posted it all, but it seemed like it would be terribly long, so I attached it instead. |
Forum: C++ Aug 21st, 2008 |
| Replies: 19 Views: 2,202 My apologies for the formatting in my recent posts. I no longer have an IDE at work and must "troubleshoot" my errors in a text editor until I get home.
Unfortunately, it doesn't hold the... |
Forum: C++ Aug 21st, 2008 |
| Replies: 19 Views: 2,202 I commented, as the other code might prove overly long
bool list::del(Contributor Del)
{
Contributor infoIn=Del; //Contributor is the object, infoIn is the specific object
... |
Forum: C++ Aug 21st, 2008 |
| Replies: 19 Views: 2,202 I'm having trouble getting my delete function to work for a singly linked list. If I try to delete anything other than the entire list, it deletes everything up to that node.
I know there is... |
Forum: C++ Aug 20th, 2008 |
| Replies: 9 Views: 1,303 Thanks Vernon, education appreciated |
Forum: C++ Aug 20th, 2008 |
| Replies: 8 Views: 1,584 Post what you have and we'll have a look
...and don't wait so long next time :)
sorry, duplicate post |
Forum: C++ Aug 20th, 2008 |
| Replies: 8 Views: 1,584 Post what you have and we'll have a look |
Forum: C++ Aug 20th, 2008 |
| Replies: 8 Views: 1,584 The above code is a c++ class for a circle. The first part is the header. The functions and data members are declared here in a public or private area of the class declaration.
The second part... |
Forum: C++ Aug 20th, 2008 |
| Replies: 9 Views: 1,303 If you're just capturing output, I don't think it matters which way you do it, as far as the user is concerned, see below :)
Pausing the program and providing a graceful exit for the user is... |
Forum: C++ Aug 20th, 2008 |
| Replies: 8 Views: 1,584 Tyra,
Folks at this site are more than happy to help. Having said that I have to tell you that they expect an attempt at coding, no matter how basic before they will help. |
Forum: C++ Aug 20th, 2008 |
| Replies: 9 Views: 1,303 I meant I'm still new to programming c++ :)
system ("PAUSE");
you can always remove it later, it's just a way to capture your output |
Forum: C++ Aug 19th, 2008 |
| Replies: 9 Views: 1,303 two things you can do from a newbie point of view
a) if you're using MS Visual Studio, try the menu option "Start without Debug" which will leave the screen up after the program finishes until you... |
Forum: C++ Aug 19th, 2008 |
| Replies: 10 Views: 1,053 Also, how do you declare the array if you want it to be an array of Contributors? |
Forum: C++ Aug 19th, 2008 |
| Replies: 11 Views: 1,258 I have a small question, why do you use the void destroyp function when you have a class destructor that appears to do the same thing?
And not to beat a dead horse as AD is an expert, but I too... |
Forum: C++ Aug 19th, 2008 |
| Replies: 10 Views: 1,053 How would you do either or both (enqueue contributor objects or pointers to the contributor objects) I guess would be my question. As a beginner as well, I'm not sure how you would pass either into... |
Forum: C++ Jul 27th, 2008 |
| Replies: 13 Views: 2,949 You were right D, he wants us to write an ordered linked list. However, he does not want us to use the template (not yet).
So my thought, for everyone here, not just Duoas, is to take out the... |
Forum: C++ Jul 20th, 2008 |
| Replies: 13 Views: 2,949 yes, he's going to make us "roll our own" linked list. This Contributor class is the base class for all the structures we'll cover. That in particular is why I wanted to make sure this class was... |
Forum: C++ Jul 20th, 2008 |
| Replies: 13 Views: 2,949 Could the function definition I wrote for "<" (and others) be used to construct an ordered linked list or should it be rewritten somehow to accomodate that use (looking ahead to my next lab)?
It... |