This tells me that the person who wrote shake sort didn't get theirs done either. You can't compile what you don't have? Anyway, your errors in your file will not be in "Compile Log", but in "Compiler" under Dev-C++. Hit Ctrl-F11 to clear out previous things and re-compile from scratch.But I don't know how to do that and keep it generic. If I could maybe store it in an array, but I'm not sure how to do that with data that can be anything. Anywho, there is only 1 error that appears in the list but it doesn't give much information.
C:\Dev-Cpp\Makefile.win [Build Error] [srtshak.o] Error 1
Dev-C++ is just gcc, so of course you can use it at a dos prompt if you need to. To get at just your code, you can try "gcc -Wall -c srtheap.c -o srtheap.o" (you may need to put gcc's directory in your path, or type it explicitly; mine is "C:\Dev-Cpp\bin\gcc").Okay let me try to give in depth what I'm trying to do. I'm trying to do a heapsort which compares the last element first. Checks the children and swaps accordingly. Now what i tried to do is say that base is where the first element is. The last element is the base + (The byte size of the element * the number of elements that there are. I tried to access the data pieces like that, but quite frankly I can't even get my professors sorting algorithms to compile. I tried some different envirnments and actually I feel quite lost. I'm working on this with another classmate right now and what he's trying to do is cast the void pointer into a char. But it doesn't seem to be working for him either. I tried to do several checks inside the loops if it has a child, has a right child if it has a left child, then I tried to swap the datapieces. If this was a constant piece of data, I wouldn't even be asking anything. I tried several times sorting a tree on paper with heapsort, and using these ideas to get to the next data piece, and they all make sense to me. But at this point I don't know whether it's my code that is having a problem or the compiler cannot compile C code. So I'm searching for something, maybe a compiler I can use at the dos prompt. Anywho, thanks again for any suggestions. I'll be continuing to work on this.
My suggestion, and I'm being serious, is to use real variable names and revise your code. Things look pretty similar to what a heapsort should be, but p1 and p2 don't always seem to mean the same thing and maybe you've got redundant checks, or maybe they're not the same check but you're reusing the names, or something. As to compiling, if you don't have all 5 .c files in hand ready to go, the build will never work. Maybe remove all but yours (and main--was that instructor written or you written?) so that you don't have to worry about the other three.