Ok I found the problem. Thanks for looking at it.
Type: Posts; User: Bizmark
Ok I found the problem. Thanks for looking at it.
Thanks I'm going to give that a try. But now after looking through everything I'm not even sure that it is getting stuck in a loop. That's what it looks like but I don't see anything wrong in the...
Hi, I have a problem with a program I am writing in C using the Dev-C++ compiler. One of my functions called crtTable seems to be getting stuck in an infinite loop. Whenever it is called in main the...
What I'm trying to do is get strtok to work its magic on the fileline variable until there are no more words in fileline for it to work its magic on. The fileline variable contains the first line out...
Ok I solved that problem. Now there is a problem with the following code:
while(!feof(file))
{
fgets(fileline, 500, file);
...
I was actually trying that just a few minutes ago, kept on popping errors at me about how it wasn't getting the correct type. I was thinking of removing the *walk pointer as well because that would...
I was under the impression that that was being taken care of recursively, could you give me an example of what I should change?
Where do you see this? Heres what I have when I'm first making the BST:
if(tst != 1)
{
while(!feof(di))
{
fscanf(di, "%s", theword);
...
Thanks for the reply. I added a global variable called int topgot so that it only assigns the top on the first run through insert function (theres still a problem though), heres the new code:
...
Hi, I'm doing a project for my Computer Science 1 class and I'm pretty much finished. However, I have a problem (I think this is the problem) with losing the top of my binary search tree. The point...
Ok, its working well now. Now I just have a few more kinks and it should be done. Thank you for all your help.
What do you mean by dropping pointer to pointer stuff? Could you take the declaration of one of my functions and change it so that I can see an example of what the rest should look like?
Ok I added it to my original post above.
So I'm having trouble getting my mergesort functions to work. The first function mergesort works fine, but then when the program calls merge it crashes. Heres mergesort:
Mergesort function
...
//Ok I did that and it seems the problem happens right when mergesort is called, because it doesn't even get to the first line of code.
Sorry i'll go ahead and comment that first line there =). It...
Hi everybody, this program I'm writing is supposed to collect comic books from a file, sort them, then print them. I'm having trouble with my mergesort functions. Heres the declaration and initial...
Yeah i fixed that problem by replacing all the '->' with '.' Now the problem is that the functions merge and mergesort aren't working, it pops an error when it calls those. I have no idea what the...
I updated all the '->' with a '.' and that seemed to fix the problem. Now the problem is when my program gets down to the mergesort command it throws a runtime error. Anyone see anything wrong with...
First of all, I'd like to thank everyone who helped me out on my last post. It helped me get to where I am right now. The problem I'm having is that my debugger (I'm using devc++) is saying that the...
Hi, I'm making a program for my CS1 class that will read in comic book names from a file, put them in a linked list, sort them, and then print them in a specific order. The problem I'm having right...
The reason that I prefer using while loops over for loops is that if necessary I can control where the increment for the condition being tested is located. For instance say I did this:
main()...
Ok I did the above. Only problem is now printArray() will not print anything to the screen. I created fillArray() so that it would return random numbers to myArray, but without pointers that won't...
Could you give me an example of some code that would work? My teacher has code setup exactly as I do that works fine. But for some reason I must be overlooking a difference between his and my code.
...
Thank you for the reply Mats. I'm not really sure what is wrong with my fillArray(). Could you elaborate a little more? Also, the error I got before all of a sudden started again, and I didn't change...
Ok so I figured out the problem. Turned out I had to put a "b" right here:
printf("Array %d: %.0lf\n", b+1, x[]); // a "b" needed to be placed in "x[]", so its "x[b]"
Now it works, but when...