Forum: C++ Apr 29th, 2009 |
| Replies: 2 Views: 245 I wrote some of it. I did use a debugger, and still couldn't figure it out. I got it down to shortpath[0] is being set to 0 in the updatepaths() method though. |
Forum: C++ Apr 29th, 2009 |
| Replies: 2 Views: 245 Hey,
So I am having this problem with this code. I think the problem is that shortpath[0].distance is being set to 0, and so never going into the if statement of updatepaths() therefore messing up... |
Forum: C++ Apr 29th, 2009 |
| Replies: 0 Views: 184 NOTE:This is a correction from my previous post.
Hey,
So I am having this problem with this code. I think the problem is that shortpath[0].distance is being set to 0, and so never going into the... |
Forum: C++ Apr 2nd, 2009 |
| Replies: 1 Views: 808 I got it partly figured out, top was being set to NULL in the print() method. So I made it so top won't be NULL anymore.
But I'm still having a problem, I think because when I addToQueue in merge... |
Forum: C++ Apr 2nd, 2009 |
| Replies: 1 Views: 808 Hello,
I need to make this program sort the numbers entered with merge sort then print them. I am having trouble calling merge sort and getting it to print.
Here is the code:
#include... |
Forum: C++ Apr 2nd, 2009 |
| Replies: 5 Views: 441 oh your right! Sorry, I don't know my problem this week, I keep forgetting stuff like that! I usually remember to do that and put mergeSort:: in front of all of the methods! |
Forum: C++ Apr 2nd, 2009 |
| Replies: 5 Views: 441 Never mind, taking out the struct Item worked.
But now, you said that i need to change Queue sort to mergeSort sort, i did that and then an error was comming up in queue saying that addToQueue can... |
Forum: C++ Apr 2nd, 2009 |
| Replies: 5 Views: 441 So about the struct, should I completely take the struct out of mergeSort? I tried doing, and changed everything in mergeSort to Data that and it caused errors. Then I tried making Item derive... |
Forum: C++ Apr 1st, 2009 |
| Replies: 5 Views: 441 Hello,
I am having trouble understanding linked lists. I have to make this program that takes input, stores it to a queue, outputs that input, then sorts it using mergesort and outputs it again. ... |
Forum: C++ Feb 25th, 2009 |
| Replies: 0 Views: 724 Hello,
I am getting 8 8 8 7 7 8 6 7 8 9
as output when I enter 1 2 3 4 5 6 7 8 9 0 into this program. It is supposed to sort the numbers one through 10. I debugged it, and believe the problem is... |
Forum: C++ Feb 25th, 2009 |
| Replies: 3 Views: 4,433 I'm still having trouble with it. When I run my code, it outputs all the last number that I entered. |
Forum: C++ Feb 25th, 2009 |
| Replies: 3 Views: 4,433 I will check that out, thanks! |
Forum: C++ Feb 25th, 2009 |
| Replies: 3 Views: 4,433 Hello,
I have to make a program using heapsort, and am having trouble getting it. I think the problem is with either fixup() or buildheap(). I am having trouble understanding the syntax for both... |
Forum: C++ Feb 5th, 2009 |
| Replies: 6 Views: 486 Nevermind, I went to my profs office and he helped me figure it out. It was just some errors with the fill variable in the queue class. Thanks! |
Forum: C++ Feb 5th, 2009 |
| Replies: 6 Views: 486 Service: W R T
Service: E F J C H
Service:
Service: ╡ ▼ X R M
Press any key to continue . . .
That is with a little change to the code.... |
Forum: C++ Feb 5th, 2009 |
| Replies: 6 Views: 486 It is suposed to print the char, not the int. |
Forum: C++ Feb 5th, 2009 |
| Replies: 6 Views: 486 Hey, So I got this program all working except some of the output is weird pictures instead of letters. The first time it outputs it works fine, but after that it only partly works.
Here's the... |
Forum: C++ Feb 4th, 2009 |
| Replies: 3 Views: 432 Well, I think my main problem is getting it to work with two different queue objects...it works with just one. |
Forum: C++ Feb 4th, 2009 |
| Replies: 3 Views: 432 Hello, I have to make this program that has two queue's. It takes input from a file, and each line in the file has a number and character. If the number is a one, the character is stored in the... |
Forum: C++ Feb 3rd, 2009 |
| Replies: 11 Views: 419 |
Forum: C++ Feb 3rd, 2009 |
| Replies: 11 Views: 419 I added an integer after the = (the teacher said we could) and it worked. |
Forum: C++ Feb 3rd, 2009 |
| Replies: 11 Views: 419 oh wow that works! Why does that keep it from printing before? Like I thought since I have cout << in the while loop, it would print each time it goes through. Is it going through the whole file... |
Forum: C++ Feb 3rd, 2009 |
| Replies: 11 Views: 419 Here are the contents of the file:
R 3
T 5
W 1
A 4
* 3
M 5
B 1
E 1
F 2 |
Forum: C++ Feb 3rd, 2009 |
| Replies: 11 Views: 419 Hey, I am having trouble with the file I/O part of this program. It seems to start at the end of the files contents and not go into the while loop.
#include "queue.cpp"
#include <iostream>... |
Forum: C++ Dec 9th, 2008 |
| Replies: 2 Views: 225 I think that I may not have linked up correctly on this one, but I'm not sure. |
Forum: C++ Dec 9th, 2008 |
| Replies: 2 Views: 225 The program is all working now, but I'm worried because on the last linked lists assignment I got a C because I did not do the link correctly. My prof said that I did not create the links up... |
Forum: C++ Dec 9th, 2008 |
| Replies: 7 Views: 388 Cool that worked. I dont fully understand why I needed to do that though, could you explain it? |
Forum: C++ Dec 9th, 2008 |
| Replies: 7 Views: 388 I'm not really sure what I am supposed to put in item. |
Forum: C++ Dec 9th, 2008 |
| Replies: 7 Views: 388 Are you saying that in linkup() i have a line that says another->item = app? |
Forum: C++ Dec 9th, 2008 |
| Replies: 7 Views: 388 will that solve my problem? |
Forum: C++ Dec 9th, 2008 |
| Replies: 7 Views: 388 Hey, This is the same code as my other forum for those of you who were helping me there. It is all working now, but when I go to call return_value from applicant.cpp(it has to be .cpp not .h because... |
Forum: C++ Dec 9th, 2008 |
| Replies: 5 Views: 430 that makes sense! Its always a simple solution lol.
Thank you very much! |
Forum: C++ Dec 8th, 2008 |
| Replies: 5 Views: 430 ok.
I changed the code a little, but at the couts I am getting weird numbers that are not in the file applicnt.dat as well as the numbers that are
here is the new code
#include "applicant.cpp"... |
Forum: C++ Dec 8th, 2008 |
| Replies: 5 Views: 430 Hey,
I am having problems with this code, I think it is not linking up the whole file, because when I run it it only says "hi" 3 times. And also it keeps crashing because of best[i] =... |
Forum: C++ Dec 3rd, 2008 |
| Replies: 2 Views: 370 The prof wrote most of..well pretty much all of the code. We just had to write the printarea() function
Thanks, I'll try what you said! |
Forum: C++ Dec 2nd, 2008 |
| Replies: 2 Views: 370 I'm having trouble making this program with linked lists work. Where I am having a problem is in printarea()
//****************************************************************
// This... |
Forum: C++ Nov 17th, 2008 |
| Replies: 9 Views: 545 that worked for printing descending! thanks! |
Forum: C++ Nov 17th, 2008 |
| Replies: 9 Views: 545 So, I got the file to read but now I'm having a new problem. Its reading it, but when I have it output all of the contents the prices are off and its leaving out one of the items and posting the... |
Forum: C++ Nov 16th, 2008 |
| Replies: 9 Views: 545 Ya, I thought there was a problem with the file not beind read from. How do I read from the file?
Thanks! |
Forum: C++ Nov 16th, 2008 |
| Replies: 9 Views: 545 I havent written the add part code yet. Right now I'm just trying to get listing it to work, and the teacher gave us the code for everything but adding it. |